Write language name in 3D ASCII: Difference between revisions
Content added Content deleted
(J: another version) |
|||
Line 987: | Line 987: | ||
For the VRML script, see [http://nsg.upor.net/jpage/jpage.htm Andrew Nikitin's J page] (search for VRML) and for the origin of the 3D J banner, see [http://www.jsoftware.com/pipermail/programming/2007-May/006539.html Oleg Kobchenko's post to the J Forums]. |
For the VRML script, see [http://nsg.upor.net/jpage/jpage.htm Andrew Nikitin's J page] (search for VRML) and for the origin of the 3D J banner, see [http://www.jsoftware.com/pipermail/programming/2007-May/006539.html Oleg Kobchenko's post to the J Forums]. |
||
Here's a slimmer version: |
|||
<lang J> view 8 8 8#:'"#$%&,4<DHLPTYZ[\'-&(a.&i.)' ' |
|||
______ |
|||
|\ \ |
|||
| \_____\ |
|||
| |\ \ |
|||
\| \_____\ |
|||
| |\ \ |
|||
\| \_____\ |
|||
| |\ \ |
|||
|\| \_____\ |
|||
| | |\ \ |
|||
| |\| \_____\ |
|||
______ |\| | | | |
|||
|\ \| \__\| | |
|||
| \_____| | \_____| |
|||
| | |\| | |
|||
|\| | \_____| |
|||
| \_____| | | |
|||
| | |\| | |
|||
\| | \_____| |
|||
\_____| | | |
|||
|\ |\| | |
|||
| \___| \_____| |
|||
| |\ | | | |
|||
\| \_|\| | |
|||
| |\| \_____| |
|||
\| | | | |
|||
| |\| | |
|||
\| \_____| |
|||
| | | |
|||
\| | |
|||
\_____| |
|||
</lang> |
|||
Explanation: the argument says where to place the solid "blocks". Each block is described by three integers, describing position along the x, y and z axis. In other words, 1 0 0 is one position to the right of 0 0 0, while 0 1 0 is one place down and 0 0 1 is one place towards the observer. (Thus the space at the top of the "slimmer" version could have been eliminated by subtracting 2 from the middle column of integers being passed to 'view'.) |
|||
It's convenient to encode these three element values as ascii characters. The original used base 5 (after subtracting 21), the alternate version used octal (after subtracting 32). |
|||
Note that the order the block positions are described in is irrelevant (the characters indicating position could be shuffled with no change in the rendered result). |
|||
=={{header|Java}}== |
=={{header|Java}}== |