23
4
I live in the UK, where it rains. A lot. I also have the unfortunate necessity to need to wear glasses to see, which means that when it rains (as it is now), I can barely see out of them. This challenge is so that you can all experience the same!
Task
Output ASCII art glasses with a drop of water added each second.
Input
None
Output
A pair of glasses with drops of water on them.
Glasses
________________________
| /__\ |
| / \ |
| / \ |
\_______/ \_______/
Raindrops
A raindrop is denoted by a .
. A raindrop is randomly placed on the glasses' lenses. So when a raindrop is placed, the glasses might look like this
________________________
| /__\ |
| . / \ |
| / \ |
\_______/ \_______/
If it is placed on a blank space (), an
.
is placed on the image. If it is placed on a square which already has a raindrop, the drop graduates.
The steps on drops are
- no drops placed:
- 1 drop placed:
.
- 2 drops placed:
o
- 3 drops placed:
O
- 4+ drops placed:
@
Rules
- The image should look as though it stays in place. This means that you can either clear the screen or print enough newlines to "clear" the screen. You cannot return a list of steps. Sorry about this, but you should be able to work around that.
- When outputting newlines to "clear" the screen, you must have at least 3 newlines between the glasses.
- The code runs until the glasses are full of fully graduated drops i.e. until the output looks like this:
________________________ |@@@@@@@@@@/__\@@@@@@@@@@| |@@@@@@@@@/ \@@@@@@@@@| |@@@@@@@@/ \@@@@@@@@| \_______/ \_______/
- Shortest code in bytes wins.
"The code runs until the glasses are full of fully graduated drops" Perhaps specify an approximate sleep/wait time? Like 150 or 250 ms? – Kevin Cruijssen – 2017-05-24T08:14:34.293
2Does the code have to stop when the glasses look like the final output or can it keep running but just not affect anything? – TheLethalCoder – 2017-05-24T08:28:25.977
@TheLethalCoder I would imagine until the glasses are full, as written in the spec :v – Jenkar – 2017-05-24T11:24:10.180
Droplet's random fall does have to fall randomly on lenses even on part of the bits of the lens that are
@
, right? – Jenkar – 2017-05-24T14:17:52.317@TheLethalCoder it should terminate after all have graduated – caird coinheringaahing – 2017-05-24T15:12:46.187
@KevinCruijssen sleep time can be anything above or equal to 1ms – caird coinheringaahing – 2017-05-24T15:17:31.040
@RandomUser Okay and
sleep time doesn't matter
does this mean you don't need to sleep at all? – TheLethalCoder – 2017-05-24T15:19:47.450