Write language name in 3D ASCII: Difference between revisions

→‎simpler, shorter: added/changed whitespace and comments, accepts any char for the letter, simplified some expressions.
No edit summary
(→‎simpler, shorter: added/changed whitespace and comments, accepts any char for the letter, simplified some expressions.)
Line 2,247:
===simpler, shorter===
This is a version of the above REXX program (with a minor bug fixed),
<br>the input text ['''*'''] has additional spacing between somethe &nbsp; ''letters'' &nbsp; for better readability,
<br>the output doesn't have extraneous leading blanks,
<br>the output doesn't have trailing blanks.,
<br>the input text can be any consistent character except the forward slash &nbsp; (<big>'''/'''</big>) &nbsp; or backward slash &nbsp;(<big>'''\'''</big>).
<lang rexx>/*REXX pgm draws a "3D" image of text representation (*any char MUSTexcept be/ used& \).*/
m.1 = '**** '
m#=7; @.21 = '* @@@@ * '
m @.32 = '*@ @ * *** * * * * '
m @.43 = '****@ @ * @@@ @ * * @ @ * * @ '
m @.54 = '* *@@@@ ** @ * @ @ *@ @ '
m @.65 = '*@ @ * @@ * @ * * *@ * '
m @.76 = '*@ @ @ * *** * @ @ * * @ @ * '
lines=7 @.7 = '@ /*number of@ lines of@@@ text for@ 3D.*/ @ @ @ '
do j=1 for lines #; x=left(strip(@.j),1) /*build the[↓] artwork fordisplay the (above) text lines.*/
A.j$.1 = changestr( " " , m@.j, ' ' ) ; A.j $.2 = A.j$.1
A.j$.1 = changestr( "*" x , A.j$.1, '///' )" "
A.j$.2 = changestr( "*" x , A.j$.2, '\\\' )" "
A.j$.1 = changestr( "/ ", A.j$.1, '/\' )
A.j$.2 = changestr( "\ ", A.j$.2, '\/' )
do k=1 for 2; say strip(left('',lines#-j) || A.j$.k,'T'); /*LEFT does endindentation*/
end /*jk*/ /* [] show display a line and its shadow.*/
end /*j*/ /*stick a fork in it, we're all done. */</lang>
{{out}} when using the default input:
<pre>
Line 2,274:
///\ ///\
\\\/ \\\/
///\ ///\ /////////\ ///\ ///\ ///\ ///\
\\\/ \\\/ \\\\\\\\\/ \\\/ \\\/ \\\/ \\\/
////////////\ ///\ ///\ ///\ ///\ ///\
\\\\\\\\\\\\/ \\\/ \\\/ \\\/ \\\/ \\\/
///\ ///\ //////\ ///\ ///\
\\\/ \\\/ \\\\\\/ \\\/ \\\/
///\ ///\ ///\ ///\ ///\ ///\ ///\
\\\/ \\\/ \\\/ \\\/ \\\/ \\\/ \\\/
///\ ///\ /////////\ ///\ ///\ ///\ ///\
\\\/ \\\/ \\\\\\\\\/ \\\/ \\\/ \\\/ \\\/
</pre>