Write language name in 3D ASCII: Difference between revisions

Added a Pascal-Solution
(Added a Pascal-Solution)
Line 1,703:
<<<> <<<> <<<<<<<<<<<<<<<> <<<> <<<> <<<> <<<> <<<<<<<<<<<<> <<<<<<<<<<<<</pre>
 
=={{header|Pascal}}==
<lang pascal>
program WritePascal;
 
const
i64: int64 = 1055120232691680095; (* This defines "Pascal" *)
cc: array[-1..15] of string = (* Here are all string-constants *)
('_______v---',
'__', '\_', '___', '\__',
' ', ' ', ' ', ' ',
'/ ', ' ', '_/ ', '\/ ',
' _', '__', ' _', ' _');
var
x, y: integer;
 
begin
for y := 0 to 7 do
begin
Write(StringOfChar(cc[(not y and 1) shl 2][1], 23 - y and 6));
Write(cc[((i64 shr (y div 2)) and 1) shl 3 + (not y and 1) shl 2 + 2]);
for x := 0 to 15 do
Write(cc[((i64 shr ((x and 15) * 4 + y div 2)) and 1) +
((i64 shr (((x + 1) and 15) * 4 + y div 2)) and 1) shl 3 +
(x mod 3) and 2 + (not y and 1) shl 2]);
writeln(cc[1 + (not y and 1) shl 2] + cc[(not y and 1) shl 3 - 1]);
end;
end.
</lang>
Need 64-Bit Integer for this solution.
My goal was to do a straight-forward solution, (Just two nested loops, no conditional code).
All characters in one place.
{{out}}
<pre>
_____ _
________________________/ \______________________________/ \________v---
_ _ ___ ___ _ ___ _
______________________/ \_/ \__/ \__/ \__/ \____/ \__/ \________v---
___ _ _ _ _ _ _ _
____________________/ \__/ \_/ \__/ \__/ \____/ \_/ \__/ \________v---
_ ___ ___ ___ ___ _
__________________/ \______/ \/ \____/ \__/ \__/ \________v---
 
</pre>
=={{header|Perl}}==
<lang perl>#!/usr/bin/perl
Anonymous user