Friday, July 22, 2011

ASCII Torus

Inspired by this guy's 3D torus rendered to an ASCII palette, I decided to spend an hour last night implementing something similar. Here's the source, and here's the result. It was a fun exercise:


@@@@@@@
@@@@$##*!!!===!!!*##$@@@@
@@@$$#*!=;;:~~-~~-~~~:~:;==!*#$$@@@
$@$$$#*!=;:~~~-~-----~~~~~~:::;=!!*#$$$@$
$$$$$##*=;~~~-----~~~~:::::::::~::;=!**#$$$$$
*$$$$$#*!=:~~------~~~~~::::::::::::::;!**#$$$$$#
*#$$$$$#*=:~--,,,-- ~:::::::=!*##$$$$#*
!*#$$$$$#*=~-,,, ~:~::!*#$$$$$#*!
;!*#$$$$$#*=,. ~~!*#$$$$$#*!;
-;!*#$$$$$$#!, ~*#$$$$$$#*!;,
~:;==**#$$$@@@$ #@@@$$$#**!=;~,
~~~:;=!*###$$@@@@ @@@@$$###*!=;:~-,
~~~::;=!***#$$$@@@@@@ @@@@@@$$$#***!=;:~~--
:~~~~~::;=!!**###$$$$@@@@@@@@@@@@@$$$$###**!!=;;:~~---,
::~~~~~~~:;;==!!****#############****!!==;;;:~~-----,
::~~~~-~~~~::;;=====!!!!!!!!!=====;;:::~---------
:::~~~~~~~-----~~:::::::::::::~~~-------------,
:::::~~~~~-~------------------------------,
:::::~~~~~~~~-----------------------,
:::::::~~~~~~~~~~~~~-----------
:::::::~~~~~~~~~~~~~-


And here it is rendered by the same utility to a higher resolution.

No comments: