Task: Write language name in 3D ASCII



C#: using System;
using System.Text;

namespace Language_name_in_3D_ascii
{
    public class F5
    {
        char[] z = { ' ', ' ', '_', '/', };
        long[,] f ={
            {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,3149249365L,3042661813L,3042661813L,3042661813L,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,},
            {366503875925L,778827027893L,778827027893L,392374737749L,368114513237L,366503875925L,366503875925L,},
            {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,},
            {3042268597L,3042268597L,3042661813L,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,}
            };

        private F5(string s)
        {
            StringBuilder[] o = new StringBuilder[7];
            for (int i = 0; i < 7; i++) o[i] = new StringBuilder();
            for (int i = 0, l = s.Length; i < l; i++)
            {
                int c = s[i];
                if (65 <= c && c <= 90) c -= 39;
                else if (97 <= c && c <= 122) c -= 97;
                else c = -1;
                long[] d = new long[7];
                Buffer.BlockCopy(f, (++c * sizeof(long) * 7), d, 0, 7 * sizeof(long));
                for (int j = 0; j < 7; j++)
                {
                    StringBuilder b = new StringBuilder();
                    long v = d[j];
                    while (v > 0)
                    {
                        b.Append(z[(int)(v & 3)]);
                        v >>= 2;
                    }
                    char[] charArray = b.ToString().ToCharArray();
                    Array.Reverse(charArray);
                    o[j].Append(new string(charArray));
                }
            }
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 7 - i; j++)
                    System.Console.Write(' ');
                System.Console.WriteLine(o[i]);
            }
        }

        public static void Main(string[] args)
        {
            new F5(args.Length > 0 ? args[0] : "C sharp");
        }
    }
}


Go: package main

import (
    "fmt"
    "strings"
)

var lean = font{
    height:  5,
    slant:   1,
    spacing: 2,
    m: map[rune][]string{
        'G': []string{
            `  _/_/_/`,
            `_/      `,
            `_/  _/_/`,
            `_/    _/`,
            `  _/_/_/`,
        },
        'o': []string{
            `        `,
            `  _/_/  `,
            `_/    _/`,
            `_/    _/`,
            `  _/_/  `,
        },
    }}

var smallKeyboard = font{
    height:  4,
    slant:   0,
    spacing: -1,
    m: map[rune][]string{
        'G': []string{
            ` ____ `,
            `||G ||`,
            `||__||`,
            `|/__\|`,
        },
        'o': []string{
            ` ____ `,
            `||o ||`,
            `||__||`,
            `|/__\|`,
        },
    }}

type font struct {
    height  int
    slant   int
    spacing int
    m       map[rune][]string
}

func render(s string, f font) string {
    rows := make([]string, f.height)
    if f.slant != 0 {
        start := 0
        if f.slant > 0 {
            start = f.height
        }
        for i := range rows {
            rows[i] = strings.Repeat(" ", (start-i)*f.slant)
        }
    }
    if f.spacing >= 0 {
        spacing := strings.Repeat(" ", f.spacing)
        for j, c := range s {
            for i, r := range f.m[c] {
                if j > 0 {
                    r = spacing + r
                }
                rows[i] += r
            }
        }
    } else {
        overlap := -f.spacing
        for j, c := range s {
            for i, r := range f.m[c] {
                if j > 0 {
                    r = r[overlap:]
                }
                rows[i] += r
            }
        }
    }
    return strings.Join(rows, "\n")
}

func main() {
    fmt.Println(render("Go", lean))
    fmt.Println(render("Go", smallKeyboard))
}