Inspired by this challenge
Goal:
The goal is to draw waves crashing onto a beach.
Input:
You will be given 3 integers (in whatever format you want) as input.
The first integer will be the length of the drawing
The second integer will be the index of the sandbar, where the waves start to crest (at least 3 spaces from beach)
The third integer will be the spacing between waves (at least 3, can be greater than length of drawing, in which case you only draw one wave)
Output:
The output will be a box of characters which shows the waves crashing into the beach. The drawing should end when the first wave has completed crashing into the beach.
At first, the wave is shown as a swell (_-_
).
As the wave passes the sandbar, it starts to crest (/c_
).
Finally, the wave crashes into the beach (/c.
=> _-_
=> ___
=> __.
).
Examples:
Input: 14 4 6
Output:
-___________..
_-__________..
__-_________..
___-________..
___/c_______..
____/c______..
-____/c_____..
_-____/c____..
__-____/c___..
___-____/c__..
___/c____/c_..
____/c____/c..
-____/c____-_.
_-____/c_____.
__-____/c___..
Input: 10, 2, 11
Output:
-_______..
_-______..
_/c_____..
__/c____..
___/c___..
____/c__..
_____/c_..
______/c..
_______-_.
_________.
________..
Input: 6 0 3
c___..
/c__..
_/c_..
c_/c..
/c_-_.
_/c__.
c_/c..
Rules:
Standard Loopholes apply
This is code-golf so shortest code wins
·
is not ASCII, which may exclude some languages. Can it be replaced by.
? \$\endgroup\$·
instead of the ASCII period? (It's actually a rather big win in my code.) \$\endgroup\$