It's friday! Which means it's time for beer!
Sadly though, today we will be golfing beer instead of drinking it. :(
Challenge
Output a beer and drink it. The amount of sips you take changes your output.
Sips
Your program should take one input string. This string can solely consist out of concatenated sip
s.
If the input is an empty string, you should output a full beer glass, including foam.
The more sips you take, the emptier your beer glass will be.
If you take 0 sips, your beer still has foam. The output of this foam is always the same (see examples).
If you take 1 sip, you should output the beer glass, followed by a new line and the string Yuck, foam.
.
If you take 1 or more sips, your beerglass should not contain anymore foam, but should show the top of your glass. Drinking the foam counts as one sip.
If you take 6 or more sips, you should output an empty beer glass, followed by a new line and the string Burp
.
For each sip you take, your beer glass should become emptier. How full your beerglass is depends on the amount of bubbles °
(°
) in your beer. For each sip you take after the foam, a line of bubbles should be removed. Each line of beer can contain a minimum of 1
and a maximum of 5
bubbles. The position of these bubbles should be 100% random.
Examples
input
empty input string, or no input at all
output
oo o oo
oooooooooooo
o| ° ° |\
| ° | \
| °° ° |} |
| ° ° | /
| ° °|/
\__________/
input
sip sip sip
output
____________
| |\
| | \
| ° |} |
|° ° ° | /
| ° ° |/
\__________/
input
sip sip sip sip sip sip sip sip sip sip
output
____________
| |\
| | \
| |} |
| | /
| |/
\__________/
Burp
This pastebin contains a list of inputs and outputs. Remember that the bubbles in the beerglass should be random!
Scoring
This is code-golf, shortest code in bytes wins!
Happy drinking golfing!
°
is the character with code point 176. \$\endgroup\$