4 ms·
You can recreate the magic in bash: while true; do printf "\u$((2571 + ($RANDOM & 1)))"; done
by caf 8y ago
You can recreate the magic in bash:
while true; do printf "\u$((2571 + ($RANDOM & 1)))"; done
- timClicks 8y agoIt's a shame that our fonts don't have the same aspect ratio. But that's a neat trick.
- Nursie 8y agoDoesn't quite work on my mac :/
- mojuba 8y agoGot it! This works on macOS. It encodes the same characters in hex UTF-8: while true; do printf "\xe2\x95\xb$((1 + ($RANDOM & 1)))"; done
- Nursie 8y agoExcellent work! Thankyou, that's awesome and very fast....
- kazinator 8y agoThe obligatory pure ASCII slash-backslash version: while true; do printf $(printf "\\\\u%04x" $((47 + 45 * ($RANDOM % 2)))); done
- fooblat 8y agoAnd for an even more "authentic" old school experience in bash: while true; do printf "\u$((2571 + ($RANDOM & 1)))"; sleep 0.02; done
- kazinator 8y agoFun task: write a program which takes such output, identifies all enclosed cells, and breaks them open, so that the maze is connected: any two points in the maze are connected by at least one path. Bonus: close loops, so any two places in the maze are connected by a unique path. As a preprocessing step, reformat the data to 77-column-long lines first, removing any whitespace characters, and discarding the last line if it is shorter than 79 characters, and then close off the exterior with solid zig-zags, like this, which are strictly added to the data (no overwriting): ╱╲╱╲╱╲...╱╲╱╲╱╲╱╲ ╲╱╲╲╲╲...╲╱╱╲╱╲╱╱ ╱╲╲╲╱╱...╱╲╱╱╲╱╲╲ ╲╱╲╲╱╲...╲╱╲╲╱╱╲╱ : : . . ╱╱╲╲╱╲...╱╱╲╱╲╱╲╲ ╲╲╱╲╲╱...╱╱╱╲╲╱╲╱ ╱╱╱╲╲╱...╱╱╱╲╱╲╱╲ ╲╱╲╱╲╱...╲╱╲╱╲╱╲╱