Task

Write/display a language's name in 3D ASCII.



(We can leave the definition of "3D ASCII" fuzzy,
so long as the result is interesting or amusing,
not a cheap hack to satisfy the task.)



Related tasks

 draw a sphere
 draw a cuboid
 draw a rotating cube
 draw a Deathstar


 
program Write_language_name_in_3D_ASCII;
 
{$APPTYPE CONSOLE}
 
uses
  System.SysUtils;
 
const
  z: TArray<char> = [' ', ' ', '_', '/'];
  f: TArray<TArray<Cardinal>> = [[87381, 87381, 87381, 87381, 87381, 87381,
    87381], [349525, 375733, 742837, 742837, 375733, 349525, 349525], [742741,
    768853, 742837, 742837, 768853, 349525, 349525], [349525, 375733, 742741,
    742741, 375733, 349525, 349525], [349621, 375733, 742837, 742837, 375733,
    349525, 349525], [349525, 375637, 768949, 742741, 375733, 349525, 349525], [351157,
    374101, 768949, 374101, 374101, 349525, 349525], [349525, 375733, 742837,
    742837, 375733, 349621, 351157], [742741, 768853, 742837, 742837, 742837,
    349525, 349525], [181, 85, 181, 181, 181, 85, 85], [1461, 1365, 1461, 1461,
    1461, 1461, 2901], [742741, 744277, 767317, 744277, 742837, 349525, 349525],
    [181, 181, 181, 181, 181, 85, 85], [1431655765, 3149249365, 3042661813,
    3042661813, 3042661813, 1431655765, 1431655765], [349525, 768853, 742837,
    742837, 742837, 349525, 349525], [349525, 375637, 742837, 742837, 375637,
    349525, 349525], [349525, 768853, 742837, 742837, 768853, 742741, 742741], [349525,
    375733, 742837, 742837, 375733, 349621, 349621], [349525, 744373, 767317,
    742741, 742741, 349525, 349525], [349525, 375733, 767317, 351157, 768853,
    349525, 349525], [374101, 768949, 374101, 374101, 351157, 349525, 349525], [349525,
    742837, 742837, 742837, 375733, 349525, 349525], [5592405, 11883957,
    11883957, 5987157, 5616981, 5592405, 5592405], [366503875925, 778827027893,
    778827027893, 392374737749, 368114513237, 366503875925, 366503875925], [349525,
    742837, 375637, 742837, 742837, 349525, 349525], [349525, 742837, 742837,
    742837, 375733, 349621, 375637], [349525, 768949, 351061, 374101, 768949,
    349525, 349525], [375637, 742837, 768949, 742837, 742837, 349525, 349525], [768853,
    742837, 768853, 742837, 768853, 349525, 349525], [375733, 742741, 742741,
    742741, 375733, 349525, 349525], [192213, 185709, 185709, 185709, 192213,
    87381, 87381], [1817525, 1791317, 1817429, 1791317, 1817525, 1398101,
    1398101], [768949, 742741, 768853, 742741, 742741, 349525, 349525], [375733,
    742741, 744373, 742837, 375733, 349525, 349525], [742837, 742837, 768949,
    742837, 742837, 349525, 349525], [48053, 23381, 23381, 23381, 48053, 21845,
    21845], [349621, 349621, 349621, 742837, 375637, 349525, 349525], [742837,
    744277, 767317, 744277, 742837, 349525, 349525], [742741, 742741, 742741,
    742741, 768949, 349525, 349525], [11883957, 12278709, 11908533, 11883957,
    11883957, 5592405, 5592405], [11883957, 12277173, 11908533, 11885493,
    11883957, 5592405, 5592405], [375637, 742837, 742837, 742837, 375637, 349525,
    349525], [768853, 742837, 768853, 742741, 742741, 349525, 349525], [6010197,
    11885397, 11909973, 11885397, 6010293, 5592405, 5592405], [768853, 742837,
    768853, 742837, 742837, 349525, 349525], [375733, 742741, 375637, 349621,
    768853, 349525, 349525], [12303285, 5616981, 5616981, 5616981, 5616981,
    5592405, 5592405], [742837, 742837, 742837, 742837, 375637, 349525, 349525],
    [11883957, 11883957, 11883957, 5987157, 5616981, 5592405, 5592405], [3042268597,
    3042268597, 3042661813, 1532713813, 1437971797, 1431655765, 1431655765], [11883957,
    5987157, 5616981, 5987157, 11883957, 5592405, 5592405], [11883957, 5987157,
    5616981, 5616981, 5616981, 5592405, 5592405], [12303285, 5593941, 5616981,
    5985621, 12303285, 5592405, 5592405]];
 
function ReverseString(s: string): string;
var
  i, len: integer;
begin
  len := s.Length;
  SetLength(Result, len);
  for i := 1 to len do
    Result[len - i + 1] := s[i];
end;
 
procedure F5(s: ansistring);
begin
  var o: TArray<TStringBuilder>;
  SetLength(o, 7);
  for var i := 0 to High(o) do
    o[i] := TStringBuilder.Create;
 
  var l := length(s);
  for var i := 1 to l do
  begin
    var c: Integer := ord(s[i]);
    if c in [65..90] then
      c := c - 39
    else if c in [97..122] then
      c := c - 97
    else
      c := -1;
 
    inc(c);
    var d: TArray<Cardinal> := f[c];
    for var j := 0 to 6 do
    begin
      var b := TStringBuilder.Create;
      var v := d[j];
 
      while v > 0 do
      begin
        b.Append(z[Trunc(v and 3)]);
        v := v shr 2;
      end;
      o[j].Append(ReverseString(b.ToString));
      b.Free;
    end;
  end;
  for var i := 0 to 6 do
  begin
    for var j := 0 to 6 - i do
      write(' ');
    writeln(o[i].ToString);
  end;
 
  for var i := 0 to High(o) do
    o[i].Free;
end;
 
begin
  F5('Delphi');
  F5('Thanks Java');
  F5('guy');
  readln;
end.