Write language name in 3D ASCII: Difference between revisions
Content added Content deleted
Fredisland (talk | contribs) |
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
||
Line 20: | Line 20: | ||
=={{header|11l}}== |
=={{header|11l}}== |
||
< |
<syntaxhighlight lang="11l">V s = |
||
|‘ XX |
|‘ XX |
||
X |
X |
||
Line 33: | Line 33: | ||
L(line) lines |
L(line) lines |
||
print((‘ ’ * (lines.len - L.index - 1))‘’(line.ljust(width).replace(‘ ’, ‘ ’).replace(‘X’, ‘__/’) * 3))</ |
print((‘ ’ * (lines.len - L.index - 1))‘’(line.ljust(width).replace(‘ ’, ‘ ’).replace(‘X’, ‘__/’) * 3))</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 48: | Line 48: | ||
=={{header|360 Assembly}}== |
=={{header|360 Assembly}}== |
||
3D EBCDIC. This program does nothing clever in any way: it just prints out strings. |
3D EBCDIC. This program does nothing clever in any way: it just prints out strings. |
||
< |
<syntaxhighlight lang="360asm">THREED CSECT |
||
STM 14,12,12(13) |
STM 14,12,12(13) |
||
BALR 12,0 |
BALR 12,0 |
||
Line 60: | Line 60: | ||
BR 14 |
BR 14 |
||
LTORG |
LTORG |
||
END</ |
END</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 74: | Line 74: | ||
=={{header|Action!}}== |
=={{header|Action!}}== |
||
Atari 8-bit computers use [https://en.wikipedia.org/wiki/ATASCII ATASCII] character set which is a variation of ASCII. |
Atari 8-bit computers use [https://en.wikipedia.org/wiki/ATASCII ATASCII] character set which is a variation of ASCII. |
||
< |
<syntaxhighlight lang="action!">BYTE ARRAY data = [ |
||
$00 $00 $00 $00 $4E $4E $4E $00 $00 $00 $00 $00 $00 $00 $00 $00 $4E $00 $00 $00 $00 $4E $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $4E $00 $00 $00 |
$00 $00 $00 $00 $4E $4E $4E $00 $00 $00 $00 $00 $00 $00 $00 $00 $4E $00 $00 $00 $00 $4E $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $4E $00 $00 $00 |
||
$00 $00 $00 $46 $47 $00 $00 $47 $00 $00 $00 $00 $00 $00 $00 $42 $47 $47 $00 $00 $42 $47 $47 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $42 $47 $47 $00 $00 |
$00 $00 $00 $46 $47 $00 $00 $47 $00 $00 $00 $00 $00 $00 $00 $42 $47 $47 $00 $00 $42 $47 $47 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $00 $42 $47 $47 $00 $00 |
||
Line 93: | Line 93: | ||
ptr=PeekC(88)+280 |
ptr=PeekC(88)+280 |
||
MoveBlock(ptr,data,400) |
MoveBlock(ptr,data,400) |
||
RETURN</ |
RETURN</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Write_language_name_in_3D_ASCII.png Screenshot from Atari 8-bit computer] |
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Write_language_name_in_3D_ASCII.png Screenshot from Atari 8-bit computer] |
||
Line 100: | Line 100: | ||
Quotes are not escaped by \ in ada (nor does \ have any meaning in strings), |
Quotes are not escaped by \ in ada (nor does \ have any meaning in strings), |
||
so this turns out highlighting funny. |
so this turns out highlighting funny. |
||
< |
<syntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO; |
||
with Ada.Strings.Fixed; use Ada.Strings.Fixed; |
with Ada.Strings.Fixed; use Ada.Strings.Fixed; |
||
procedure AsciiArt is |
procedure AsciiArt is |
||
Line 116: | Line 116: | ||
if i mod 3 = 0 then New_Line; Put(i/3*' '); end if; |
if i mod 3 = 0 then New_Line; Put(i/3*' '); end if; |
||
end loop; |
end loop; |
||
end AsciiArt;</ |
end AsciiArt;</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 131: | Line 131: | ||
=={{header|Arturo}}== |
=={{header|Arturo}}== |
||
< |
<syntaxhighlight lang="rebol">print {: |
||
______ __ |
______ __ |
||
/\ _ \ /\ \__ |
/\ _ \ /\ \__ |
||
Line 139: | Line 139: | ||
\ \_\ \_\ \_\ \ \__\\ \____/\ \_\\ \____/ |
\ \_\ \_\ \_\ \ \__\\ \____/\ \_\\ \____/ |
||
\/_/\/_/\/_/ \/__/ \/___/ \/_/ \/___/ |
\/_/\/_/\/_/ \/__/ \/___/ \/_/ \/___/ |
||
:}</ |
:}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 152: | Line 152: | ||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |
||
< |
<syntaxhighlight lang="autohotkey">AutoTrim, Off |
||
draw = |
draw = |
||
( |
( |
||
Line 169: | Line 169: | ||
GuiClose: |
GuiClose: |
||
ExitApp</ |
ExitApp</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> ______ __ __ __ __ |
<pre> ______ __ __ __ __ |
||
Line 179: | Line 179: | ||
=={{header|AWK}}== |
=={{header|AWK}}== |
||
<syntaxhighlight lang="awk"> |
|||
<lang AWK> |
|||
# syntax: GAWK -f WRITE_LANGUAGE_NAME_IN_3D_ASCII.AWK |
# syntax: GAWK -f WRITE_LANGUAGE_NAME_IN_3D_ASCII.AWK |
||
BEGIN { |
BEGIN { |
||
Line 198: | Line 198: | ||
exit(0) |
exit(0) |
||
} |
} |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 214: | Line 214: | ||
==={{header|Applesoft BASIC}}=== |
==={{header|Applesoft BASIC}}=== |
||
Ported from [[Write language name in 3D ASCII#ZX Spectrum Basic|ZX Spectrum Basic]].< |
Ported from [[Write language name in 3D ASCII#ZX Spectrum Basic|ZX Spectrum Basic]].<syntaxhighlight lang="applesoftbasic">10 S$ = "BASIC" : REM OUR LANGUAGE NAME |
||
20 DIM B(5,5) : REM OUR BIGMAP CHARACTERS |
20 DIM B(5,5) : REM OUR BIGMAP CHARACTERS |
||
30 FOR L = 1 TO 5 : REM 5 CHARACTERS |
30 FOR L = 1 TO 5 : REM 5 CHARACTERS |
||
Line 262: | Line 262: | ||
9030 DATA 31,4,4,4,31: REM I |
9030 DATA 31,4,4,4,31: REM I |
||
9040 DATA 14,17,16,17,14: REM C |
9040 DATA 14,17,16,17,14: REM C |
||
</syntaxhighlight> |
|||
</lang> |
|||
==={{header|BBC BASIC}}=== |
==={{header|BBC BASIC}}=== |
||
{{works with|BBC BASIC for Windows}} |
{{works with|BBC BASIC for Windows}} |
||
Uses the built-in '''BBC Micro'''-compatible character generator, so any text can be specified. |
Uses the built-in '''BBC Micro'''-compatible character generator, so any text can be specified. |
||
< |
<syntaxhighlight lang="bbcbasic"> PROC3dname("BBC BASIC") |
||
END |
END |
||
Line 288: | Line 288: | ||
PRINT |
PRINT |
||
NEXT row% |
NEXT row% |
||
ENDPROC</ |
ENDPROC</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 303: | Line 303: | ||
==={{header|FreeBASIC}}=== |
==={{header|FreeBASIC}}=== |
||
freebasic is quite a long name, so I have done a combi. |
freebasic is quite a long name, so I have done a combi. |
||
< |
<syntaxhighlight lang="freebasic">dim as integer yres=hiword(width) |
||
dim as integer xres=loword(width) |
dim as integer xres=loword(width) |
||
Line 330: | Line 330: | ||
print "BASIC" |
print "BASIC" |
||
Sleep |
Sleep |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> \ \ \ \ \ \ \ \ \ \ \ \ |
<pre> \ \ \ \ \ \ \ \ \ \ \ \ |
||
Line 351: | Line 351: | ||
==={{header|Liberty BASIC}}=== |
==={{header|Liberty BASIC}}=== |
||
<syntaxhighlight lang="lb"> |
|||
<lang lb> |
|||
r=21:s=9:c=s |
r=21:s=9:c=s |
||
For i=1 To 11 |
For i=1 To 11 |
||
Line 370: | Line 370: | ||
Next |
Next |
||
Data 479667712,311470336,485697536,311699712,476292608,0,1976518785,1160267905,1171157123,1160267909,1171223529 |
Data 479667712,311470336,485697536,311699712,476292608,0,1976518785,1160267905,1171157123,1160267909,1171223529 |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
Line 440: | Line 440: | ||
==={{header|TI-83 BASIC}}=== |
==={{header|TI-83 BASIC}}=== |
||
< |
<syntaxhighlight lang="ti83b">Disp “ .....+ .....+ |
||
Disp “ +o+ooo +o+ooo |
Disp “ +o+ooo +o+ooo |
||
Disp “ .o .o |
Disp “ .o .o |
||
Line 446: | Line 446: | ||
Disp “ +o +ooooo |
Disp “ +o +ooooo |
||
Disp “ |
Disp “ |
||
Disp “ BASIC</ |
Disp “ BASIC</syntaxhighlight> |
||
Replace . + o with 0x81,0x80,and 0x7F http://tibasicdev.wikidot.com/one-byte-tokens |
Replace . + o with 0x81,0x80,and 0x7F http://tibasicdev.wikidot.com/one-byte-tokens |
||
Line 458: | Line 458: | ||
but the output would still look the same. |
but the output would still look the same. |
||
Fixed the error and removed the need for 2^z. |
Fixed the error and removed the need for 2^z. |
||
< |
<syntaxhighlight lang="zxbasic"> 10 DIM b(5,5): REM our bigmap characters |
||
20 FOR l=1 TO 5: REM 5 characters |
20 FOR l=1 TO 5: REM 5 characters |
||
30 FOR m=1 TO 5: REM 5 rows |
30 FOR m=1 TO 5: REM 5 rows |
||
Line 494: | Line 494: | ||
9020 DATA 15,16,14,1,30: REM S |
9020 DATA 15,16,14,1,30: REM S |
||
9030 DATA 31,4,4,4,31: REM I |
9030 DATA 31,4,4,4,31: REM I |
||
9040 DATA 14,17,16,17,14: REM C</ |
9040 DATA 14,17,16,17,14: REM C</syntaxhighlight> |
||
To me it does not work. So I bring my particular solution: |
To me it does not work. So I bring my particular solution: |
||
< |
<syntaxhighlight lang="zxbasic">5 PAPER 0: CLS |
||
10 LET d=0: INK 1: GO SUB 40 |
10 LET d=0: INK 1: GO SUB 40 |
||
20 LET d=1: INK 6: GO SUB 40 |
20 LET d=1: INK 6: GO SUB 40 |
||
Line 515: | Line 515: | ||
150 DATA "XXX XXXX XXX X X " |
150 DATA "XXX XXXX XXX X X " |
||
160 DATA "X X X X X X X " |
160 DATA "X X X X X X X " |
||
170 DATA "XXX X X XXX X XXX"</ |
170 DATA "XXX X X XXX X XXX"</syntaxhighlight> |
||
[[File:Basic.jpg]] |
[[File:Basic.jpg]] |
||
=={{header|Batch File}}== |
=={{header|Batch File}}== |
||
< |
<syntaxhighlight lang="dos">@echo off |
||
for %%b in ( |
for %%b in ( |
||
"" |
"" |
||
Line 533: | Line 533: | ||
"" |
"" |
||
) do echo(%%~b |
) do echo(%%~b |
||
pause</ |
pause</syntaxhighlight> |
||
=={{header|Befunge}}== |
=={{header|Befunge}}== |
||
===Befunge-93=== |
===Befunge-93=== |
||
< |
<syntaxhighlight lang="befunge">0" &7&%h&'&%| &7&%7%&%&'&%&'&%&7&%"v |
||
v"'%$%'%$%3$%$%7% 0%&7&%&7&(%$%'%$"< |
v"'%$%'%$%3$%$%7% 0%&7&%&7&(%$%'%$"< |
||
>"%$%7%$%&%$%&'&%7%$%7%$%, '&+(%$%"v |
>"%$%7%$%&%$%&'&%7%$%7%$%, '&+(%$%"v |
||
Line 546: | Line 546: | ||
? ";(;(+(+$%+(%&(;(3%$%&$ 7`+( ":v > |
? ";(;(+(+$%+(%&(;(3%$%&$ 7`+( ":v > |
||
^v!:-1<\,:g7+*63%4 \/_#4:_v#:-*84_$@ |
^v!:-1<\,:g7+*63%4 \/_#4:_v#:-*84_$@ |
||
$_\:,\^ >55+,$:^:$</ |
$_\:,\^ >55+,$:^:$</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 562: | Line 562: | ||
(It adds line offset to those strings,and the strings are encoded with numbers just because.) |
(It adds line offset to those strings,and the strings are encoded with numbers just because.) |
||
{{works with|CCBI|2.1}} |
{{works with|CCBI|2.1}} |
||
<syntaxhighlight lang="befunge"> |
|||
<lang Befunge> |
|||
v THE DATA IMAGE.(totally useless after loading into stack) |
v THE DATA IMAGE.(totally useless after loading into stack) |
||
>89 v Made by gamemanj |
>89 v Made by gamemanj |
||
Line 598: | Line 598: | ||
" " |
" " |
||
^ $,< < < (code path reuse here,all 3 end in ,$ so I merged them) |
^ $,< < < (code path reuse here,all 3 end in ,$ so I merged them) |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 612: | Line 612: | ||
=={{header|Brainf***}}== |
=={{header|Brainf***}}== |
||
Coming up with decent 3D font was honestly the hardest part. |
Coming up with decent 3D font was honestly the hardest part. |
||
< |
<syntaxhighlight lang="bf">++++[>++++>++<[>>++>+++>++++++> ++++++<<<<<-]<-]>>++>..>->----> |
||
-...[<]<+++[>++++[>>...<<-]<-]> >>..>>>.....<<<..>>>...[<]++[>> |
-...[<]<+++[>++++[>>...<<-]<-]> >>..>>>.....<<<..>>>...[<]++[>> |
||
.....>>>...<<<<<-]>.>.>.>.<<..> >.[<]<+++++[>++++[>>.<<-]<-]>>> |
.....>>>...<<<<<-]>.>.>.>.<<..> >.[<]<+++++[>++++[>>.<<-]<-]>>> |
||
Line 627: | Line 627: | ||
..>>.<<.>>.>......<..>..<.<<..> >.<<.>>.>...<<.>.>..<..>..<..>. |
..>>.<<.>>.>......<..>..<.<<..> >.<<.>>.>...<<.>.>..<..>..<..>. |
||
.<..<<.>>.>..<..>..<.<<<.>..... .>>.<.>>......<<..>>..<<.<...>> |
.<..<<.>>.>..<..>..<.<<<.>..... .>>.<.>>......<<..>>..<<.<...>> |
||
.<.>>..<<.>.<.>>..<<..>>..<<..> >..<<.<.>>.<.>>..<<..>>..<<.<<.</ |
.<.>>..<<.>.<.>>..<<..>>..<<..> >..<<.<.>>.<.>>..<<..>>..<<.<<.</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 641: | Line 641: | ||
=={{header|C}}== |
=={{header|C}}== |
||
3D enough?< |
3D enough?<syntaxhighlight lang="c">#include <stdio.h> |
||
const char*s = " _____\n /____/\\\n/ ___\\/\n\\ \\/__/\n \\____/"; |
const char*s = " _____\n /____/\\\n/ ___\\/\n\\ \\/__/\n \\____/"; |
||
int main(){ puts(s); return 0; }</ |
int main(){ puts(s); return 0; }</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 654: | Line 654: | ||
=={{header|C sharp|C#}}== |
=={{header|C sharp|C#}}== |
||
< |
<syntaxhighlight lang="csharp">using System; |
||
using System.Text; |
using System.Text; |
||
Line 757: | Line 757: | ||
} |
} |
||
} |
} |
||
}</ |
}</syntaxhighlight> |
||
Output: |
Output: |
||
Line 769: | Line 769: | ||
=={{header|C++}}== |
=={{header|C++}}== |
||
< |
<syntaxhighlight lang="cpp"> |
||
#include <windows.h> |
#include <windows.h> |
||
#include <iostream> |
#include <iostream> |
||
Line 799: | Line 799: | ||
} |
} |
||
//-------------------------------------------------------------------------------------------------- |
//-------------------------------------------------------------------------------------------------- |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 817: | Line 817: | ||
</pre> |
</pre> |
||
Another solution: |
Another solution: |
||
< |
<syntaxhighlight lang="cpp"> |
||
// @author Martin Ettl (http://www.martinettl.de) |
// @author Martin Ettl (http://www.martinettl.de) |
||
// @date 2013-07-26 |
// @date 2013-07-26 |
||
Line 841: | Line 841: | ||
return 0; |
return 0; |
||
} |
} |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 857: | Line 857: | ||
=={{header|Clojure}}== |
=={{header|Clojure}}== |
||
{{libheader|clj-figlet}} |
{{libheader|clj-figlet}} |
||
< |
<syntaxhighlight lang="clojure">(use 'clj-figlet.core) |
||
(println |
(println |
||
(render-to-string |
(render-to-string |
||
(load-flf "ftp://ftp.figlet.org/pub/figlet/fonts/contributed/larry3d.flf") |
(load-flf "ftp://ftp.figlet.org/pub/figlet/fonts/contributed/larry3d.flf") |
||
"Clojure"))</ |
"Clojure"))</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 879: | Line 879: | ||
This displays 'COBOL' in 3D with a shadow effect. The font is 'Slant Relief' from [http://http://patorjk.com/software/taag/ here]. |
This displays 'COBOL' in 3D with a shadow effect. The font is 'Slant Relief' from [http://http://patorjk.com/software/taag/ here]. |
||
{{works with|OpenCOBOL}} |
{{works with|OpenCOBOL}} |
||
< |
<syntaxhighlight lang="cobol"> IDENTIFICATION DIVISION. |
||
PROGRAM-ID. cobol-3d. |
PROGRAM-ID. cobol-3d. |
||
Line 956: | Line 956: | ||
GOBACK |
GOBACK |
||
.</ |
.</syntaxhighlight> |
||
{{out}} (note: the shadow effect is quite faint on this site): |
{{out}} (note: the shadow effect is quite faint on this site): |
||
Line 973: | Line 973: | ||
=={{header|Common Lisp}}== |
=={{header|Common Lisp}}== |
||
{{libheader|cl-ppcre}} |
{{libheader|cl-ppcre}} |
||
< |
<syntaxhighlight lang="lisp"> |
||
(ql:quickload :cl-ppcre) |
(ql:quickload :cl-ppcre) |
||
(defvar txt |
(defvar txt |
||
Line 986: | Line 986: | ||
) |
) |
||
(princ (cl-ppcre:regex-replace-all " " (cl-ppcre:regex-replace-all "x" txt "_/") " " )) |
(princ (cl-ppcre:regex-replace-all " " (cl-ppcre:regex-replace-all "x" txt "_/") " " )) |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 999: | Line 999: | ||
=={{header|ContextFree}}== |
=={{header|ContextFree}}== |
||
<syntaxhighlight lang="contextfree"> |
|||
<lang contextFree> |
|||
startshape START |
startshape START |
||
Line 1,101: | Line 1,101: | ||
ARCL [ size 0.97 y 0.55 r 1.5 ] |
ARCL [ size 0.97 y 0.55 r 1.5 ] |
||
} |
} |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
[https://www.contextfreeart.org/gallery/view.php?id=4205 Output Image] |
[https://www.contextfreeart.org/gallery/view.php?id=4205 Output Image] |
||
Line 1,107: | Line 1,107: | ||
=={{header|D}}== |
=={{header|D}}== |
||
This generates a single image ASCII stereogram. |
This generates a single image ASCII stereogram. |
||
< |
<syntaxhighlight lang="d">// Derived from AA3D - ASCII art stereogram generator |
||
// by Jan Hubicka and Thomas Marsh |
// by Jan Hubicka and Thomas Marsh |
||
// (GNU General Public License) |
// (GNU General Public License) |
||
Line 1,165: | Line 1,165: | ||
writeln(); |
writeln(); |
||
} |
} |
||
}</ |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre>nguageDLangunguageDLangunguageDLangunguageDLangung |
<pre>nguageDLangunguageDLangunguageDLangunguageDLangung |
||
Line 1,181: | Line 1,181: | ||
=={{header|Dart}}== |
=={{header|Dart}}== |
||
< |
<syntaxhighlight lang="dart"> |
||
void main(){ |
void main(){ |
||
print(""" |
print(""" |
||
Line 1,191: | Line 1,191: | ||
""".replaceAll('X','_/')); |
""".replaceAll('X','_/')); |
||
} |
} |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 1,204: | Line 1,204: | ||
{{libheader| System.SysUtils}} |
{{libheader| System.SysUtils}} |
||
{{Trans|Java}} |
{{Trans|Java}} |
||
<syntaxhighlight lang="delphi"> |
|||
<lang Delphi> |
|||
program Write_language_name_in_3D_ASCII; |
program Write_language_name_in_3D_ASCII; |
||
Line 1,318: | Line 1,318: | ||
F5('guy'); |
F5('guy'); |
||
readln; |
readln; |
||
end.</ |
end.</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> _/_/_/ _/ _/ _/ |
<pre> _/_/_/ _/ _/ _/ |
||
Line 1,343: | Line 1,343: | ||
=={{header|Elixir}}== |
=={{header|Elixir}}== |
||
< |
<syntaxhighlight lang="elixir">defmodule ASCII3D do |
||
def decode(str) do |
def decode(str) do |
||
Regex.scan(~r/(\d+)(\D+)/, str) |
Regex.scan(~r/(\d+)(\D+)/, str) |
||
Line 1,355: | Line 1,355: | ||
2 3 B5_1/4 6 B3 1B/_/2 /1_2 6 B1\n3 3 B10_6 B3 3 /2B_1_6 B1 |
2 3 B5_1/4 6 B3 1B/_/2 /1_2 6 B1\n3 3 B10_6 B3 3 /2B_1_6 B1 |
||
4 2 B11_2B 1B_B2 B1_B 3 /1B/_/B_B2 B B_B1\n6 1B/11_1/3 B/_/2 3 B/_/" |
4 2 B11_2B 1B_B2 B1_B 3 /1B/_/B_B2 B B_B1\n6 1B/11_1/3 B/_/2 3 B/_/" |
||
IO.puts ASCII3D.decode(data)</ |
IO.puts ASCII3D.decode(data)</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 1,371: | Line 1,371: | ||
=={{header|Erlang}}== |
=={{header|Erlang}}== |
||
< |
<syntaxhighlight lang="erlang">%% Implemented by Arjun Sunel |
||
-module(three_d). |
-module(three_d). |
||
-export([main/0]). |
-export([main/0]). |
||
Line 1,377: | Line 1,377: | ||
main() -> |
main() -> |
||
io:format(" _____ _ \n| ___| | | \n| |__ _ __| | __ _ _ __ __ _ \n| __| '__| |/ _` | '_ \\ / _` |\n| |__| | | | (_| | | | | (_| |\n|____/_| |_|\\__,_|_| |_|\\__, |\n __/ |\n |___/\n"). |
io:format(" _____ _ \n| ___| | | \n| |__ _ __| | __ _ _ __ __ _ \n| __| '__| |/ _` | '_ \\ / _` |\n| |__| | | | (_| | | | | (_| |\n|____/_| |_|\\__,_|_| |_|\\__, |\n __/ |\n |___/\n"). |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 1,393: | Line 1,393: | ||
'''3D ASCII:''' |
'''3D ASCII:''' |
||
{{trans|Elixir}} |
{{trans|Elixir}} |
||
< |
<syntaxhighlight lang="erlang">-module(ascii3d). |
||
-export([decode/1]). |
-export([decode/1]). |
||
Line 1,401: | Line 1,401: | ||
Joined = string:join(lists:flatmap(Fun, Splited), ""), |
Joined = string:join(lists:flatmap(Fun, Splited), ""), |
||
Lines = binary:replace(binary:list_to_bin(Joined), <<"B">>, <<"\\">>, [global]), |
Lines = binary:replace(binary:list_to_bin(Joined), <<"B">>, <<"\\">>, [global]), |
||
io:format("~s~n", [Lines]).</ |
io:format("~s~n", [Lines]).</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 1,426: | Line 1,426: | ||
=={{header|ERRE}}== |
=={{header|ERRE}}== |
||
< |
<syntaxhighlight lang="erre">PROGRAM 3D_NAME |
||
DIM TBL$[17,1] |
DIM TBL$[17,1] |
||
Line 1,462: | Line 1,462: | ||
END PROGRAM |
END PROGRAM |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 1,486: | Line 1,486: | ||
=={{header|F_Sharp|F#}}== |
=={{header|F_Sharp|F#}}== |
||
< |
<syntaxhighlight lang="fsharp">let make2Darray (picture : string list) = |
||
let maxY = picture.Length |
let maxY = picture.Length |
||
let maxX = picture |> List.maxBy String.length |> String.length |
let maxX = picture |> List.maxBy String.length |> String.length |
||
Line 1,529: | Line 1,529: | ||
if x = 0 then printfn "" |
if x = 0 then printfn "" |
||
printf "%c" c) a2 |
printf "%c" c) a2 |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 1,546: | Line 1,546: | ||
=={{header|Forth}}== |
=={{header|Forth}}== |
||
=== Text strings === |
=== Text strings === |
||
< |
<syntaxhighlight lang="forth">\ Rossetta Code Write language name in 3D ASCII |
||
\ Simple Method |
\ Simple Method |
||
Line 1,563: | Line 1,563: | ||
( test at the console ) |
( test at the console ) |
||
page "forth" |
page "forth" |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
Line 1,583: | Line 1,583: | ||
=== Bit Matrix Method === |
=== Bit Matrix Method === |
||
< |
<syntaxhighlight lang="forth">\ Original code: "Short phrases with BIG Characters by Wil Baden 2003-02-23 |
||
\ Modified BFox for simple 3D presentation 2015-07-14 |
\ Modified BFox for simple 3D presentation 2015-07-14 |
||
Line 1,685: | Line 1,685: | ||
\ test the solution in the Forth console |
\ test the solution in the Forth console |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
Line 1,715: | Line 1,715: | ||
For the interest component of the task, I thought about rendering the result from an input string and realized that it wasn't completely trivial as the glyphs of the Lean font overlap with the standard letter spacing. Rendering different fonts would add interest because now there would be a point in developing a common font representation and rendering function. Block and Lean would have sufficed, but I looked further and found the Keyboard and Small Keyboard fonts. These I found somewhat amusing, for the final component of the task. |
For the interest component of the task, I thought about rendering the result from an input string and realized that it wasn't completely trivial as the glyphs of the Lean font overlap with the standard letter spacing. Rendering different fonts would add interest because now there would be a point in developing a common font representation and rendering function. Block and Lean would have sufficed, but I looked further and found the Keyboard and Small Keyboard fonts. These I found somewhat amusing, for the final component of the task. |
||
< |
<syntaxhighlight lang="go">package main |
||
import ( |
import ( |
||
Line 1,807: | Line 1,807: | ||
fmt.Println(render("Go", lean)) |
fmt.Println(render("Go", lean)) |
||
fmt.Println(render("Go", smallKeyboard)) |
fmt.Println(render("Go", smallKeyboard)) |
||
}</ |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 1,823: | Line 1,823: | ||
=={{header|Groovy}}== |
=={{header|Groovy}}== |
||
A simple way to display ASCII art |
A simple way to display ASCII art |
||
< |
<syntaxhighlight lang="groovy">println """\ |
||
_|_|_| |
_|_|_| |
||
_| _| _|_| _|_| _|_| _| _| _| _| |
_| _| _|_| _|_| _|_| _| _| _| _| |
||
Line 1,830: | Line 1,830: | ||
_|_|_| _| _|_| _|_| _| _|_|_| |
_|_|_| _| _|_| _|_| _| _|_|_| |
||
_| |
_| |
||
_|_|"""</ |
_|_|"""</syntaxhighlight> |
||
A more complicated example: |
A more complicated example: |
||
< |
<syntaxhighlight lang="groovy">String.metaClass.getAsAsciiArt = { |
||
def request = "http://www.network-science.de/ascii/ascii.php?TEXT=${delegate}&x=23&y=10&FONT=block&RICH=no&FORM=left&STRE=no&WIDT=80" |
def request = "http://www.network-science.de/ascii/ascii.php?TEXT=${delegate}&x=23&y=10&FONT=block&RICH=no&FORM=left&STRE=no&WIDT=80" |
||
def html = new URL(request).text |
def html = new URL(request).text |
||
Line 1,838: | Line 1,838: | ||
} |
} |
||
println "Groovy".asAsciiArt</ |
println "Groovy".asAsciiArt</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> _|_|_| |
<pre> _|_|_| |
||
Line 1,850: | Line 1,850: | ||
=={{header|Haskell}}== |
=={{header|Haskell}}== |
||
A simple printing of the ASCII art |
A simple printing of the ASCII art |
||
< |
<syntaxhighlight lang="haskell">module Main where |
||
{- |
{- |
||
__ __ __ ___ ___ |
__ __ __ ___ ___ |
||
Line 1,871: | Line 1,871: | ||
main = putStrLn ascii3d |
main = putStrLn ascii3d |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
Line 1,885: | Line 1,885: | ||
=={{header|Icon}} and {{header|Unicon}}== |
=={{header|Icon}} and {{header|Unicon}}== |
||
The following fits under the fuzzy definition of 3D ASCII and pays homage to one of the Icon Newsletter logos. |
The following fits under the fuzzy definition of 3D ASCII and pays homage to one of the Icon Newsletter logos. |
||
< |
<syntaxhighlight lang="icon">procedure main(arglist) |
||
write(ExpandText( |
write(ExpandText( |
||
if !arglist == "icon" then |
if !arglist == "icon" then |
||
Line 1,918: | Line 1,918: | ||
s ? until pos(0) do |
s ? until pos(0) do |
||
writes(repl(" ",tab(many(&digits)))|tab(upto(&digits)|0)) |
writes(repl(" ",tab(many(&digits)))|tab(upto(&digits)|0)) |
||
end</ |
end</syntaxhighlight> |
||
{{out}} with "icon" as the argument: |
{{out}} with "icon" as the argument: |
||
Line 1,954: | Line 1,954: | ||
=={{header|J}}== |
=={{header|J}}== |
||
< |
<syntaxhighlight lang="j"> require 'vrml.ijs' NB. Due to Andrew Nikitin |
||
view 5#.^:_1]21-~a.i.'j*ez`C3\toy.G)' NB. Due to Oleg Kobchenko |
view 5#.^:_1]21-~a.i.'j*ez`C3\toy.G)' NB. Due to Oleg Kobchenko |
||
________________________ |
________________________ |
||
Line 1,976: | Line 1,976: | ||
\| | | | |
\| | | | |
||
\_____|_____|_____| |
\_____|_____|_____| |
||
</syntaxhighlight> |
|||
</lang> |
|||
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]. |
||
Line 1,982: | Line 1,982: | ||
Here's a slimmer version: |
Here's a slimmer version: |
||
< |
<syntaxhighlight lang="j"> view 8 8 8#:'"#$%&,4<DHLPTYZ[\'-&(a.&i.)' ' |
||
Line 2,018: | Line 2,018: | ||
\| | |
\| | |
||
\_____| |
\_____| |
||
</syntaxhighlight> |
|||
</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'.) |
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'.) |
||
Line 2,030: | Line 2,030: | ||
It's not really that obfuscated. The characters in <var>z</var> are used to draw the letters. The array <var>f</var> contains one element per letter of the alphabet. Each array element is another array of 7 longs because each output letter is made of 7 lines of text. Each long value represents a sequence of 2-bit integers that are extracted by bit-twiddling and used to find the right character in <var>z</var>. |
It's not really that obfuscated. The characters in <var>z</var> are used to draw the letters. The array <var>f</var> contains one element per letter of the alphabet. Each array element is another array of 7 longs because each output letter is made of 7 lines of text. Each long value represents a sequence of 2-bit integers that are extracted by bit-twiddling and used to find the right character in <var>z</var>. |
||
< |
<syntaxhighlight lang="java">public class F5{ |
||
char[]z={' ',' ','_','/',}; |
char[]z={' ',' ','_','/',}; |
||
long[][]f={ |
long[][]f={ |
||
Line 2,108: | Line 2,108: | ||
System.out.print(' '); |
System.out.print(' '); |
||
System.out.println(o[i]);}}} |
System.out.println(o[i]);}}} |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} With no parameters: |
{{out}} With no parameters: |
||
Line 2,137: | Line 2,137: | ||
One small point of interest here is the use of string interpolation to simulate a "heredoc" string. |
One small point of interest here is the use of string interpolation to simulate a "heredoc" string. |
||
< |
<syntaxhighlight lang="jq">def jq: |
||
"\(" |
"\(" |
||
# |
# |
||
Line 2,153: | Line 2,153: | ||
| [[range(length;0;-1) | " " * .], . ] | transpose[] | join("") ; |
| [[range(length;0;-1) | " " * .], . ] | transpose[] | join("") ; |
||
banner3D</ |
banner3D</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 2,169: | Line 2,169: | ||
=={{header|Julia}}== |
=={{header|Julia}}== |
||
{{trans|Awk}} |
{{trans|Awk}} |
||
< |
<syntaxhighlight lang="julia">println(replace(raw""" |
||
xxxxx |
xxxxx |
||
x x |
x x |
||
Line 2,179: | Line 2,179: | ||
xx xx x x x x xx |
xx xx x x x x xx |
||
""", "x" => "_/")) |
""", "x" => "_/")) |
||
</ |
</syntaxhighlight>{{output}}<pre> |
||
_/_/_/_/_/ |
_/_/_/_/_/ |
||
_/ _/ |
_/ _/ |
||
Line 2,192: | Line 2,192: | ||
=={{header|Kotlin}}== |
=={{header|Kotlin}}== |
||
{{trans|Java}} |
{{trans|Java}} |
||
< |
<syntaxhighlight lang="scala">// version 1.1 |
||
class Ascii3D(s: String) { |
class Ascii3D(s: String) { |
||
Line 2,288: | Line 2,288: | ||
Ascii3D("of the") |
Ascii3D("of the") |
||
Ascii3D("Java entry") |
Ascii3D("Java entry") |
||
}</ |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 2,330: | Line 2,330: | ||
=={{header|Lasso}}== |
=={{header|Lasso}}== |
||
< |
<syntaxhighlight lang="lasso">local(lasso = " |
||
--------------------------------------------------------------- |
--------------------------------------------------------------- |
||
| ,--, | |
| ,--, | |
||
Line 2,349: | Line 2,349: | ||
") |
") |
||
stdoutnl(#lasso)</ |
stdoutnl(#lasso)</syntaxhighlight> |
||
<pre>--------------------------------------------------------------- |
<pre>--------------------------------------------------------------- |
||
| ,--, | |
| ,--, | |
||
Line 2,369: | Line 2,369: | ||
=={{header|Lua}}== |
=={{header|Lua}}== |
||
< |
<syntaxhighlight lang="lua">io.write(" /$$\n") |
||
io.write("| $$\n") |
io.write("| $$\n") |
||
io.write("| $$ /$$ /$$ /$$$$$$\n") |
io.write("| $$ /$$ /$$ /$$$$$$\n") |
||
Line 2,376: | Line 2,376: | ||
io.write("| $$ | $$ | $$ /$$__ $$\n") |
io.write("| $$ | $$ | $$ /$$__ $$\n") |
||
io.write("| $$$$$$$$| $$$$$$/| $$$$$$$\n") |
io.write("| $$$$$$$$| $$$$$$/| $$$$$$$\n") |
||
io.write("|________/ \______/ \_______/\n")</ |
io.write("|________/ \______/ \_______/\n")</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> /$$ |
<pre> /$$ |
||
Line 2,387: | Line 2,387: | ||
|________/ ______/ _______/</pre> |
|________/ ______/ _______/</pre> |
||
Alternate: |
Alternate: |
||
< |
<syntaxhighlight lang="lua">print[[ |
||
__ |
__ |
||
/\ \ |
/\ \ |
||
Line 2,394: | Line 2,394: | ||
\ \ \___\ \ \_\ \/\ \_\ \_ |
\ \ \___\ \ \_\ \/\ \_\ \_ |
||
\ \____\\ \____/\ \___/\_\ |
\ \____\\ \____/\ \___/\_\ |
||
\/____/ \/___/ \/__/\/_/]]</ |
\/____/ \/___/ \/__/\/_/]]</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> __ |
<pre> __ |
||
Line 2,406: | Line 2,406: | ||
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
=={{header|Mathematica}}/{{header|Wolfram Language}}== |
||
No hardcoding at all! |
No hardcoding at all! |
||
< |
<syntaxhighlight lang="mathematica">locs = Position[ |
||
ImageData[Binarize[Rasterize["Mathematica", ImageSize -> 150]]], 0]; |
ImageData[Binarize[Rasterize["Mathematica", ImageSize -> 150]]], 0]; |
||
Print[StringRiffle[ |
Print[StringRiffle[ |
||
Line 2,414: | Line 2,414: | ||
ConstantArray[ |
ConstantArray[ |
||
" ", {Max[locs[[All, 1]]] + 1, Max[locs[[All, 2]]] + 1}], |
" ", {Max[locs[[All, 1]]] + 1, Max[locs[[All, 2]]] + 1}], |
||
locs -> "\\"], Map[# + 1 &, locs, {2}] -> "#"], "\n"]];</ |
locs -> "\\"], Map[# + 1 &, locs, {2}] -> "#"], "\n"]];</syntaxhighlight> |
||
{{output}} |
{{output}} |
||
<pre> |
<pre> |
||
Line 2,439: | Line 2,439: | ||
=={{header|MiniScript}}== |
=={{header|MiniScript}}== |
||
Nothing fancy here, but in keeping with MiniScript's "clear and simple" ethos: |
Nothing fancy here, but in keeping with MiniScript's "clear and simple" ethos: |
||
< |
<syntaxhighlight lang="miniscript">data = [ |
||
" ______ _____ _________", |
" ______ _____ _________", |
||
"|\ \/ \ ___ ________ ___|\ _____\ ________ ________ ___ ________ _________ ", |
"|\ \/ \ ___ ________ ___|\ _____\ ________ ________ ___ ________ _________ ", |
||
Line 2,451: | Line 2,451: | ||
for line in data |
for line in data |
||
print line |
print line |
||
end for</ |
end for</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> ______ _____ _________ |
<pre> ______ _____ _________ |
||
Line 2,463: | Line 2,463: | ||
=={{header|Modula-2}}== |
=={{header|Modula-2}}== |
||
< |
<syntaxhighlight lang="modula2">MODULE Art; |
||
FROM Terminal IMPORT WriteString,WriteLn,ReadChar; |
FROM Terminal IMPORT WriteString,WriteLn,ReadChar; |
||
Line 2,501: | Line 2,501: | ||
ReadChar |
ReadChar |
||
END Art. |
END Art. |
||
</syntaxhighlight> |
|||
</lang> |
|||
=={{header|Nanoquery}}== |
=={{header|Nanoquery}}== |
||
< |
<syntaxhighlight lang="nanoquery">println " ________ ________ ________ ________ ________ ___ ___ _______ ________ ___ ___ " |
||
println "|\\ ___ \\|\\ __ \\|\\ ___ \\|\\ __ \\|\\ __ \\|\\ \\|\\ \\|\\ ___ \\ |\\ __ \\ |\\ \\ / /| " |
println "|\\ ___ \\|\\ __ \\|\\ ___ \\|\\ __ \\|\\ __ \\|\\ \\|\\ \\|\\ ___ \\ |\\ __ \\ |\\ \\ / /| " |
||
println "\\ \\ \\\\ \\ \\ \\ \\|\\ \\ \\ \\\\ \\ \\ \\ \\|\\ \\ \\ \\|\\ \\ \\ \\\\\\ \\ \\ __/|\\ \\ \\|\\ \\ \\ \\ \\/ / / " |
println "\\ \\ \\\\ \\ \\ \\ \\|\\ \\ \\ \\\\ \\ \\ \\ \\|\\ \\ \\ \\|\\ \\ \\ \\\\\\ \\ \\ __/|\\ \\ \\|\\ \\ \\ \\ \\/ / / " |
||
Line 2,511: | Line 2,511: | ||
println " \\ \\__\\\\ \\__\\ \\__\\ \\__\\ \\__\\\\ \\__\\ \\_______\\ \\_____ \\ \\_______\\ \\_______\\ \\__\\\\ _\\ __/ / / " |
println " \\ \\__\\\\ \\__\\ \\__\\ \\__\\ \\__\\\\ \\__\\ \\_______\\ \\_____ \\ \\_______\\ \\_______\\ \\__\\\\ _\\ __/ / / " |
||
println " \\|__| \\|__|\\|__|\\|__|\\|__| \\|__|\\|_______|\\|___| \\__\\|_______|\\|_______|\\|__|\\|__|\\___/ / " |
println " \\|__| \\|__|\\|__|\\|__|\\|__| \\|__|\\|_______|\\|___| \\__\\|_______|\\|_______|\\|__|\\|__|\\___/ / " |
||
println " \\|__| \\|___|/ "</ |
println " \\|__| \\|___|/ "</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> ________ ________ ________ ________ ________ ___ ___ _______ ________ ___ ___ |
<pre> ________ ________ ________ ________ ________ ___ ___ _______ ________ ___ ___ |
||
Line 2,524: | Line 2,524: | ||
=={{header|NetRexx}}== |
=={{header|NetRexx}}== |
||
Based on an idea found in the [[#Scala|Scala]] version. |
Based on an idea found in the [[#Scala|Scala]] version. |
||
< |
<syntaxhighlight lang="netrexx">/* NetRexx */ |
||
options replace format comments java crossref symbols nobinary |
options replace format comments java crossref symbols nobinary |
||
Line 2,589: | Line 2,589: | ||
method isFalse public constant binary returns boolean |
method isFalse public constant binary returns boolean |
||
return \isTrue() |
return \isTrue() |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 2,610: | Line 2,610: | ||
=={{header|Nim}}== |
=={{header|Nim}}== |
||
{{trans|Python}} |
{{trans|Python}} |
||
< |
<syntaxhighlight lang="nim">import strutils |
||
const nim = """ |
const nim = """ |
||
Line 2,622: | Line 2,622: | ||
let lines = nim.dedent.multiReplace(("#", "<<<"), (" ", " "), ("< ", "<>"), ("<\n", "<>\n")).splitLines |
let lines = nim.dedent.multiReplace(("#", "<<<"), (" ", " "), ("< ", "<>"), ("<\n", "<>\n")).splitLines |
||
for i, line in lines: |
for i, line in lines: |
||
echo spaces(lines.len - i), line</ |
echo spaces(lines.len - i), line</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> <<< <<< <<<<<<<<<<<<<<< <<< <<< |
<pre> <<< <<< <<<<<<<<<<<<<<< <<< <<< |
||
Line 2,632: | Line 2,632: | ||
=={{header|OCaml}}== |
=={{header|OCaml}}== |
||
<syntaxhighlight lang="ocaml"> |
|||
<lang OCaml> |
|||
print_string " |
print_string " |
||
_|_|_| _|_|_| _|_| _|_| _|_| _| |
_|_|_| _|_|_| _|_| _|_| _|_| _| |
||
Line 2,640: | Line 2,640: | ||
_|_|_| _|_|_| _| _| _| _| _|_|_|_|_| |
_|_|_| _|_|_| _| _| _| _| _|_|_|_|_| |
||
" |
" |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 2,652: | Line 2,652: | ||
=={{header|Pascal}}== |
=={{header|Pascal}}== |
||
< |
<syntaxhighlight lang="pascal"> |
||
program WritePascal; |
program WritePascal; |
||
Line 2,678: | Line 2,678: | ||
end; |
end; |
||
end. |
end. |
||
</syntaxhighlight> |
|||
</lang> |
|||
Need 64-Bit Integer for this solution. |
Need 64-Bit Integer for this solution. |
||
My goal was to do a straight-forward solution, (Just two nested loops, no conditional code). |
My goal was to do a straight-forward solution, (Just two nested loops, no conditional code). |
||
Line 2,696: | Line 2,696: | ||
=={{header|Perl}}== |
=={{header|Perl}}== |
||
< |
<syntaxhighlight lang="perl">#!/usr/bin/perl |
||
use strict; |
use strict; |
||
use warnings; |
use warnings; |
||
Line 2,706: | Line 2,706: | ||
) { |
) { |
||
print $tuple->[0] x $tuple->[1]; |
print $tuple->[0] x $tuple->[1]; |
||
}</ |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> _ \ | |
<pre> _ \ | |
||
Line 2,715: | Line 2,715: | ||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
<!--< |
<!--<syntaxhighlight lang="phix">(phixonline)--> |
||
<span style="color: #008080;">constant</span> <span style="color: #000000;">s</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""" |
<span style="color: #008080;">constant</span> <span style="color: #000000;">s</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""" |
||
------*** * |
------*** * |
||
Line 2,726: | Line 2,726: | ||
"""</span> |
"""</span> |
||
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">substitute_all</span><span style="color: #0000FF;">(</span><span style="color: #000000;">s</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"* "</span><span style="color: #0000FF;">,{</span><span style="color: #008000;">"_/"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">" "</span><span style="color: #0000FF;">}))</span> |
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">substitute_all</span><span style="color: #0000FF;">(</span><span style="color: #000000;">s</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"* "</span><span style="color: #0000FF;">,{</span><span style="color: #008000;">"_/"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">" "</span><span style="color: #0000FF;">}))</span> |
||
<!--</ |
<!--</syntaxhighlight>--> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 2,739: | Line 2,739: | ||
===obfuscated=== |
===obfuscated=== |
||
For those of you who like this sort of thing, same output |
For those of you who like this sort of thing, same output |
||
<!--< |
<!--<syntaxhighlight lang="phix">(phixonline)--> |
||
<span style="color: #008080;">constant</span> <span style="color: #000000;">q</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{</span><span style="color: #000000;">0(30)10C</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(31)176</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(32)2A4</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(33)6N3</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(34)7GP</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(35)DWF</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(36)QC4</span><span style="color: #0000FF;">}</span> |
<span style="color: #008080;">constant</span> <span style="color: #000000;">q</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{</span><span style="color: #000000;">0(30)10C</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(31)176</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(32)2A4</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(33)6N3</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(34)7GP</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(35)DWF</span><span style="color: #0000FF;">,</span><span style="color: #000000;">0(36)QC4</span><span style="color: #0000FF;">}</span> |
||
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">substitute_all</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">join</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%16b"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">7</span><span style="color: #0000FF;">),</span><span style="color: #008000;">"\n"</span><span style="color: #0000FF;">),</span><span style="color: #000000;">q</span><span style="color: #0000FF;">),</span><span style="color: #008000;">" 10"</span><span style="color: #0000FF;">,{</span><span style="color: #008000;">"-"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"_/"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">" "</span><span style="color: #0000FF;">})&</span><span style="color: #008000;">"\n"</span><span style="color: #0000FF;">)</span> |
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">substitute_all</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">join</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%16b"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">7</span><span style="color: #0000FF;">),</span><span style="color: #008000;">"\n"</span><span style="color: #0000FF;">),</span><span style="color: #000000;">q</span><span style="color: #0000FF;">),</span><span style="color: #008000;">" 10"</span><span style="color: #0000FF;">,{</span><span style="color: #008000;">"-"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"_/"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">" "</span><span style="color: #0000FF;">})&</span><span style="color: #008000;">"\n"</span><span style="color: #0000FF;">)</span> |
||
<!--</ |
<!--</syntaxhighlight>--> |
||
===another version=== |
===another version=== |
||
Inspired by Ruby |
Inspired by Ruby |
||
<!--< |
<!--<syntaxhighlight lang="phix">(phixonline)--> |
||
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">""" |
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">""" |
||
__ ________ |
__ ________ |
||
Line 2,765: | Line 2,765: | ||
<span style="color: #008000;">"\\ \\ \\ \\ \\_\\ /\n / / / \\ \\ \\ \\ \\ \\ / / \\\n/_/ / \\"</span><span style="color: #0000FF;">&</span> |
<span style="color: #008000;">"\\ \\ \\ \\ \\_\\ /\n / / / \\ \\ \\ \\ \\ \\ / / \\\n/_/ / \\"</span><span style="color: #0000FF;">&</span> |
||
<span style="color: #008000;">" \\ \\ \\ \\ \\ /_/ /\\ \\\n\\_\\/ \\_\\/ \\_\\/ \\_\\/\\_\\/\n"</span><span style="color: #0000FF;">)</span> |
<span style="color: #008000;">" \\ \\ \\ \\ \\ /_/ /\\ \\\n\\_\\/ \\_\\/ \\_\\/ \\_\\/\\_\\/\n"</span><span style="color: #0000FF;">)</span> |
||
<!--</ |
<!--</syntaxhighlight>--> |
||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |
||
{{Trans|Tcl}} |
{{Trans|Tcl}} |
||
< |
<syntaxhighlight lang="picolisp">(de Lst |
||
"***** * " |
"***** * " |
||
"* * * * * " |
"* * * * * " |
||
Line 2,803: | Line 2,803: | ||
(maplist '((X) (transform X "/" "\\")) (cdr Lst)) ) |
(maplist '((X) (transform X "/" "\\")) (cdr Lst)) ) |
||
(bye)</ |
(bye)</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 2,819: | Line 2,819: | ||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |
||
< |
<syntaxhighlight lang="purebasic">If OpenConsole() |
||
PrintN(" ////\ ////\ ////| ") |
PrintN(" ////\ ////\ ////| ") |
||
PrintN(" //// \ __ //// \ __ |XX|_/ ") |
PrintN(" //// \ __ //// \ __ |XX|_/ ") |
||
Line 2,836: | Line 2,836: | ||
Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() |
Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input() |
||
CloseConsole() |
CloseConsole() |
||
EndIf</ |
EndIf</syntaxhighlight> |
||
Sample output: |
Sample output: |
||
<pre> ////\ ////\ ////| |
<pre> ////\ ////\ ////| |
||
Line 2,855: | Line 2,855: | ||
=={{header|Python}}== |
=={{header|Python}}== |
||
<b>Implementation 1:</b> based on the Scala type idea of 'fleshing out' a 2D banner version. |
<b>Implementation 1:</b> based on the Scala type idea of 'fleshing out' a 2D banner version. |
||
< |
<syntaxhighlight lang="python">py = '''\ |
||
##### # # ##### # # #### # # |
##### # # ##### # # #### # # |
||
# # # # # # # # # ## # |
# # # # # # # # # ## # |
||
Line 2,866: | Line 2,866: | ||
lines = py.replace('#', '<<<').replace(' ','X').replace('X', ' ').replace('\n', ' Y').replace('< ', '<>').split('Y') |
lines = py.replace('#', '<<<').replace(' ','X').replace('X', ' ').replace('\n', ' Y').replace('< ', '<>').split('Y') |
||
for i, l in enumerate(lines): |
for i, l in enumerate(lines): |
||
print( ' ' * (len(lines) - i) + l)</ |
print( ' ' * (len(lines) - i) + l)</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 2,877: | Line 2,877: | ||
<b>Implementation 2:</b> |
<b>Implementation 2:</b> |
||
< |
<syntaxhighlight lang="python">charWidth = 10 |
||
charHeight = 8 |
charHeight = 8 |
||
Line 2,949: | Line 2,949: | ||
endStr = (val + 1) * charWidth # end string position of 3D letter |
endStr = (val + 1) * charWidth # end string position of 3D letter |
||
lineOut += charTable[i][beginStr:endStr] |
lineOut += charTable[i][beginStr:endStr] |
||
print(lineOut)</ |
print(lineOut)</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 2,962: | Line 2,962: | ||
<b>Implementation 3:</b> a more general solution that scrapes http://www.network-science.de/ascii for the ASCII art. |
<b>Implementation 3:</b> a more general solution that scrapes http://www.network-science.de/ascii for the ASCII art. |
||
< |
<syntaxhighlight lang="python">import requests |
||
import html |
import html |
||
Line 2,978: | Line 2,978: | ||
ascii_text = ascii_text[:ascii_text.index(post_ascii)] |
ascii_text = ascii_text[:ascii_text.index(post_ascii)] |
||
print(ascii_text)</ |
print(ascii_text)</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> ____ __ __ |
<pre> ____ __ __ |
||
Line 2,992: | Line 2,992: | ||
=={{header|Quackery}}== |
=={{header|Quackery}}== |
||
< |
<syntaxhighlight lang="quackery">say " ________ ___ ___ ________ ________ ___ __ _______ ________ ___ ___" cr |
||
say "|\ __ \|\ \|\ \|\ __ \|\ ____\|\ \|\ \ |\ ___ \ |\ __ \|\ \ / /|" cr |
say "|\ __ \|\ \|\ \|\ __ \|\ ____\|\ \|\ \ |\ ___ \ |\ __ \|\ \ / /|" cr |
||
say "\ \ \|\ \ \ \ \ \ \ \|\ \ \ \___|\ \ \/ /|\ \ __/|\ \ \|\ \ \ \/ / /" cr |
say "\ \ \|\ \ \ \ \ \ \ \|\ \ \ \___|\ \ \/ /|\ \ __/|\ \ \|\ \ \ \/ / /" cr |
||
Line 3,001: | Line 3,001: | ||
say " \ \ \_______________________________________________________/ / /" cr |
say " \ \ \_______________________________________________________/ / /" cr |
||
say " \ \____________________________________________________________/ /" cr |
say " \ \____________________________________________________________/ /" cr |
||
say " \|____________________________________________________________|/" cr</ |
say " \|____________________________________________________________|/" cr</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 3,022: | Line 3,022: | ||
Use the GUI to create a text banner: |
Use the GUI to create a text banner: |
||
< |
<syntaxhighlight lang="racket"> |
||
#lang racket/gui |
#lang racket/gui |
||
Line 3,065: | Line 3,065: | ||
(for ([line (dropf-right (dropf lines empty?) empty?)]) |
(for ([line (dropf-right (dropf lines empty?) empty?)]) |
||
(displayln (string-trim line #:left? #f)))) |
(displayln (string-trim line #:left? #f)))) |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
Line 3,086: | Line 3,086: | ||
(formerly Perl 6) |
(formerly Perl 6) |
||
Produces a good old-fashioned stereogram, meant to be looked at by focusing beyond the screen, not by crossing your eyes. If you can't get it to converge, try shrinking the font size till the images are closer together than your eyes. Also helps to be old enough to have progressive lenses, so you can look through the reading part of your glasses. Or borrow glasses from someone who's farsighted. <tt>:-)</tt> |
Produces a good old-fashioned stereogram, meant to be looked at by focusing beyond the screen, not by crossing your eyes. If you can't get it to converge, try shrinking the font size till the images are closer together than your eyes. Also helps to be old enough to have progressive lenses, so you can look through the reading part of your glasses. Or borrow glasses from someone who's farsighted. <tt>:-)</tt> |
||
<lang |
<syntaxhighlight lang="raku" line># must be evenly padded with white-space$ |
||
my $text = q:to/END/; |
my $text = q:to/END/; |
||
Line 3,108: | Line 3,108: | ||
.say; |
.say; |
||
} |
} |
||
say '' for ^5;</ |
say '' for ^5;</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<small><pre> |
<small><pre> |
||
Line 3,133: | Line 3,133: | ||
=={{header|Raven}}== |
=={{header|Raven}}== |
||
<syntaxhighlight lang="raven">[ |
|||
<lang Raven>[ |
|||
" ##### #### # # #### # #" |
" ##### #### # # #### # #" |
||
" # # # # # # # ## #" |
" # # # # # # # ## #" |
||
Line 3,150: | Line 3,150: | ||
$line r/#/@@@/g r/ /X/g r/X/ /g r/@ /@!/g r/@$/@!/g as $l1 |
$line r/#/@@@/g r/ /X/g r/X/ /g r/@ /@!/g r/@$/@!/g as $l1 |
||
$l1 "@" split $r1 join "!" split $r2 join print "\n" print |
$l1 "@" split $r1 join "!" split $r2 join print "\n" print |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{out}} |
{{out}} |
||
<pre> ///////////////> ////////////> ///> ///> ////////////> ///> ///> |
<pre> ///////////////> ////////////> ///> ///> ////////////> ///> ///> |
||
Line 3,167: | Line 3,167: | ||
This REXX has been used as part of a test suite for some REXX interpreters to stress test their syntax parser. |
This REXX has been used as part of a test suite for some REXX interpreters to stress test their syntax parser. |
||
< |
<syntaxhighlight lang="rexx">/*REXX program that displays a "REXX" 3D "ASCII art" as a logo. */ |
||
signal . /* Uses left-hand shadows, slightly raised view. |
signal . /* Uses left-hand shadows, slightly raised view. |
||
0=5~2?A?2?A? |
0=5~2?A?2?A? |
||
Line 3,193: | Line 3,193: | ||
,13,u));_=_('=',left('',16,u));_=_('#','|\\|');_=translate(_,"|"u,'@"') |
,13,u));_=_('=',left('',16,u));_=_('#','|\\|');_=translate(_,"|"u,'@"') |
||
do k=0 for 16;x=d2x(k,1);_=_(x,left('',k+1));end;say ' '_;end;exit;_:return, |
do k=0 for 16;x=d2x(k,1);_=_(x,left('',k+1));end;say ' '_;end;exit;_:return, |
||
changestr(arg(1),_,arg(2))</ |
changestr(arg(1),_,arg(2))</syntaxhighlight> |
||
Some older REXXes don't have a '''changestr''' BIF, so one is included here ──► [[CHANGESTR.REX]]. |
Some older REXXes don't have a '''changestr''' BIF, so one is included here ──► [[CHANGESTR.REX]]. |
||
Line 3,222: | Line 3,222: | ||
{{Works with|ooRexx}} |
{{Works with|ooRexx}} |
||
{{Works with|Regina}} |
{{Works with|Regina}} |
||
< |
<syntaxhighlight lang="rexx">/* Rexx */ |
||
drop !top !bot |
drop !top !bot |
||
Line 3,288: | Line 3,288: | ||
isFalse: |
isFalse: |
||
procedure |
procedure |
||
return \isTrue()</ |
return \isTrue()</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> ///////////////\ |
<pre> ///////////////\ |
||
Line 3,312: | Line 3,312: | ||
<br>the output doesn't have trailing blanks, |
<br>the output doesn't have trailing blanks, |
||
<br>the input text can be any consistent non-blank character except the forward slash (<big>'''/'''</big>) or backward slash (<big>'''\'''</big>). |
<br>the input text can be any consistent non-blank character except the forward slash (<big>'''/'''</big>) or backward slash (<big>'''\'''</big>). |
||
< |
<syntaxhighlight lang="rexx">/*REXX pgm draws a "3D" image of text representation; any character except / and \ */ |
||
#=7; @.1 = '@@@@ ' |
#=7; @.1 = '@@@@ ' |
||
@.2 = '@ @ ' |
@.2 = '@ @ ' |
||
Line 3,328: | Line 3,328: | ||
do k=1 for 2; say strip(left('',#-j)$.k,"T") /*the LEFT BIF does indentation.*/ |
do k=1 for 2; say strip(left('',#-j)$.k,"T") /*the LEFT BIF does indentation.*/ |
||
end /*k*/ /* [↑] display a line and its shadow.*/ |
end /*k*/ /* [↑] display a line and its shadow.*/ |
||
end /*j*/ /*stick a fork in it, we're all done. */</ |
end /*j*/ /*stick a fork in it, we're all done. */</syntaxhighlight> |
||
{{out|output|text= when using the internal default input:}} |
{{out|output|text= when using the internal default input:}} |
||
<pre> |
<pre> |
||
Line 3,348: | Line 3,348: | ||
=={{header|Ruby}}== |
=={{header|Ruby}}== |
||
< |
<syntaxhighlight lang="ruby">text = <<EOS |
||
#### # |
#### # |
||
# # # |
# # # |
||
Line 3,412: | Line 3,412: | ||
# |
# |
||
# |
# |
||
EOS</ |
EOS</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 3,460: | Line 3,460: | ||
'''Another version:''' like a 3D solid. |
'''Another version:''' like a 3D solid. |
||
< |
<syntaxhighlight lang="ruby">enc = "9 8u18 2u1\n8 1s 6u1 b16 1s sb\n6 2 s1b4u1s sb13 3 s1\n5 3 s3 3s 11 3 s1\n4 2 s1us3u1su2s 2u4 2u3 2 s1us3u4 2u6 2u1\n4 1s 6u1sbubs2 s1b 2 s1b2 1s 6u1 b2 1susb3 2 s1b\n2 2 s1b2 3u1bs2 8 s1b4u1s s4b 3 s1\n 3 s3b 2 9 s3 3s 3 b2s 1s\n 3s 3 b1 2 s2us4 s1us2u2us1 s3 3 b1s s\nsu2s 2 4 b6u2s 1s7u1sbubs6 1bub2 1s\nbubs6 1bubs2 1b5u1bs b7u1bs8 3 s1\n42 2u2s 1s\n41 1s3u1s s\n41 1b3u1bs\n" |
||
def decode(str) |
def decode(str) |
||
str.split(/(\d+)(\D+)/).each_slice(3).map{|_,n,s| s * n.to_i}.join.tr('sub','/_\\') |
str.split(/(\d+)(\D+)/).each_slice(3).map{|_,n,s| s * n.to_i}.join.tr('sub','/_\\') |
||
end |
end |
||
puts decode(enc)</ |
puts decode(enc)</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 3,485: | Line 3,485: | ||
=={{header|Rust}}== |
=={{header|Rust}}== |
||
< |
<syntaxhighlight lang="rust">pub fn char_from_id(id: u8) -> char { |
||
[' ', '#', '/', '_', 'L', '|', '\n'][id as usize] |
[' ', '#', '/', '_', 'L', '|', '\n'][id as usize] |
||
} |
} |
||
Line 3,522: | Line 3,522: | ||
println!("{}", decode(&code)); |
println!("{}", decode(&code)); |
||
}</ |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 3,537: | Line 3,537: | ||
{{libheader|Scala}} |
{{libheader|Scala}} |
||
===Java style=== |
===Java style=== |
||
< |
<syntaxhighlight lang="scala">def ASCII3D = { |
||
val name = """ |
val name = """ |
||
Line 3,598: | Line 3,598: | ||
} |
} |
||
println(ASCII3D)</ |
println(ASCII3D)</syntaxhighlight> |
||
===Idiomatic=== |
===Idiomatic=== |
||
Cleaner code. |
Cleaner code. |
||
< |
<syntaxhighlight lang="scala">import scala.collection.mutable.ArraySeq |
||
object Ascii3D extends App { |
object Ascii3D extends App { |
||
Line 3,641: | Line 3,641: | ||
println(ASCII3D) |
println(ASCII3D) |
||
}</ |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 3,657: | Line 3,657: | ||
=={{header|Seed7}}== |
=={{header|Seed7}}== |
||
< |
<syntaxhighlight lang="seed7">$include "seed7_05.s7i"; |
||
const array string: name is [] ( |
const array string: name is [] ( |
||
Line 3,698: | Line 3,698: | ||
end for; |
end for; |
||
writeln(previousLine); |
writeln(previousLine); |
||
end func;</ |
end func;</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 3,716: | Line 3,716: | ||
=={{header|Sidef}}== |
=={{header|Sidef}}== |
||
{{trans|Ruby}} |
{{trans|Ruby}} |
||
< |
<syntaxhighlight lang="ruby">var text = <<'EOT'; |
||
*** |
*** |
||
Line 3,736: | Line 3,736: | ||
}; |
}; |
||
say banner3D(text);</ |
say banner3D(text);</syntaxhighlight> |
||
<pre> |
<pre> |
||
Line 3,752: | Line 3,752: | ||
=={{header|SQL}}== |
=={{header|SQL}}== |
||
< |
<syntaxhighlight lang="sql">select ' SSS\ ' as s, ' QQQ\ ' as q, 'L\ ' as l from dual |
||
union all select 'S \|', 'Q Q\ ', 'L | ' from dual |
union all select 'S \|', 'Q Q\ ', 'L | ' from dual |
||
union all select '\SSS ', 'Q Q |', 'L | ' from dual |
union all select '\SSS ', 'Q Q |', 'L | ' from dual |
||
Line 3,758: | Line 3,758: | ||
union all select ' SSS |', '\QQQ\\|', 'LLLL\' from dual |
union all select ' SSS |', '\QQQ\\|', 'LLLL\' from dual |
||
union all select ' \__\/', ' \_Q_/ ', '\___\' from dual |
union all select ' \__\/', ' \_Q_/ ', '\___\' from dual |
||
union all select ' ', ' \\ ', ' ' from dual;</ |
union all select ' ', ' \\ ', ' ' from dual;</syntaxhighlight> |
||
This works in Oracle. For other databases, try it without "from dual". |
This works in Oracle. For other databases, try it without "from dual". |
||
{{out}} |
{{out}} |
||
Line 3,775: | Line 3,775: | ||
=={{header|Tcl}}== |
=={{header|Tcl}}== |
||
< |
<syntaxhighlight lang="tcl">package require Tcl 8.5 |
||
proc mergeLine {upper lower} { |
proc mergeLine {upper lower} { |
||
Line 3,810: | Line 3,810: | ||
{ * *** *} |
{ * *** *} |
||
} |
} |
||
printLines $lines</ |
printLines $lines</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Line 3,824: | Line 3,824: | ||
=={{header|UNIX Shell}}== |
=={{header|UNIX Shell}}== |
||
{{works with|Bash|4}} |
{{works with|Bash|4}} |
||
< |
<syntaxhighlight lang="sh">#!/usr/bin/env bash |
||
mapfile -t name <<EOF |
mapfile -t name <<EOF |
||
Aimhacks |
Aimhacks |
||
Line 3,887: | Line 3,887: | ||
main "$@" |
main "$@" |
||
</syntaxhighlight> |
|||
</lang> |
|||
{{Out}} |
{{Out}} |
||
<pre> __/__/__/ __/ |
<pre> __/__/__/ __/ |
||
Line 3,934: | Line 3,934: | ||
=={{header|Visual Basic .NET}}== |
=={{header|Visual Basic .NET}}== |
||
{{trans|C#}} |
{{trans|C#}} |
||
< |
<syntaxhighlight lang="vbnet">Module Module1 |
||
Sub Main() |
Sub Main() |
||
Line 3,950: | Line 3,950: | ||
End Sub |
End Sub |
||
End Module</ |
End Module</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> ___ ___ ___ ________ ___ ___ ________ ___ ________ ________ ________ ___ ________ ________ _______ _________ |
<pre> ___ ___ ___ ________ ___ ___ ________ ___ ________ ________ ________ ___ ________ ________ _______ _________ |
||
Line 3,965: | Line 3,965: | ||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
This uses the 3D ASCII letter font [https://github.com/arpan98/3dwrite/blob/master/3d_font.txt here]. |
This uses the 3D ASCII letter font [https://github.com/arpan98/3dwrite/blob/master/3d_font.txt here]. |
||
< |
<syntaxhighlight lang="ecmascript">var w = """ |
||
____ ____ ____ |
____ ____ ____ |
||
|\ \ |\ \ |\ \ |
|\ \ |\ \ |\ \ |
||
Line 4,015: | Line 4,015: | ||
for (i in 0..8) { |
for (i in 0..8) { |
||
System.print("%(w[i]) %(r[i]) %(e[i]) %(n[i])") |
System.print("%(w[i]) %(r[i]) %(e[i]) %(n[i])") |
||
}</ |
}</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 4,032: | Line 4,032: | ||
=={{header|XPL0}}== |
=={{header|XPL0}}== |
||
Here's XPL0's "cheap hack." (Hats off to D!) |
Here's XPL0's "cheap hack." (Hats off to D!) |
||
< |
<syntaxhighlight lang="xpl0">include c:\cxpl\codes; |
||
proc DrawBlock(X, Y); |
proc DrawBlock(X, Y); |
||
Line 4,058: | Line 4,058: | ||
]; |
]; |
||
]; |
]; |
||
]</ |
]</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
Line 4,081: | Line 4,081: | ||
=={{header|Yabasic}}== |
=={{header|Yabasic}}== |
||
<syntaxhighlight lang="yabasic"> |
|||
<lang Yabasic> |
|||
// Method 1 |
// Method 1 |
||
// r$ = system$("explorer \"http://www.network-science.de/ascii/ascii.php?TEXT=${delegate}&x=23&y=10&FONT=block&RICH=no&FORM=left&STRE=no&WIDT=80&TEXT=Yabasic\"") |
// r$ = system$("explorer \"http://www.network-science.de/ascii/ascii.php?TEXT=${delegate}&x=23&y=10&FONT=block&RICH=no&FORM=left&STRE=no&WIDT=80&TEXT=Yabasic\"") |
||
Line 4,119: | Line 4,119: | ||
write(2, 2, "\\") |
write(2, 2, "\\") |
||
write(1, 1, "#") |
write(1, 1, "#") |
||
print</ |
print</syntaxhighlight> |
||
=={{header|zkl}}== |
=={{header|zkl}}== |
||
{{trans|Common Lisp}} |
{{trans|Common Lisp}} |
||
< |
<syntaxhighlight lang="zkl">#<<< |
||
" |
" |
||
xxxxxx x x x |
xxxxxx x x x |
||
Line 4,132: | Line 4,132: | ||
" |
" |
||
#<<<< |
#<<<< |
||
.replace(" "," ").replace("x","_/").println();</ |
.replace(" "," ").replace("x","_/").println();</syntaxhighlight> |
||
{{out}} |
{{out}} |
||
<pre> |
<pre> |