Back in 2013, I started “CodeSth” and had a thought about drawing an ASCII tidal wave, here is a code I just wrapped up quick for fun:
#!/bin/bash
WIDTH=$(tput cols)
w='.)`-,.'
printf -v sep '%*s' $((WIDTH - ${#w}))
w="$w${sep// /_}"
while sleep .05; do
echo "${w:x}${w:0:x}"
((x = (x + 1) % ${#w}))
done
There is nothing special about it, it just paints the wave with a separator line and my not-so-artistic ASCII sense. Basically, it cycles through by characters, print by each iteration. In the output, it looks as if you are looking at the ocean at an angle or 30 degrees or 60 degrees.
Now, dim the light, play soothing music, light up a scented candle, yeah, right, like I really do that. But if you want to do so, my lips are sealed.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.