#!/usr/bin/ruby

#
## https://rosettacode.org/wiki/Write_language_name_in_3D_ASCII
#

var text = <<'EOT';

     ***
    *     *     *        **
    *           *       *
    *     *     *  ***  **
     ***  *  **** *   * *
        * * *   * ***** *
        * * *   * *     *
        * * *   * *     *
     ***  *  ****  ***  *
EOT

func banner3D(text, shift=-1) {
    var txt = text.lines.map{|line| line.gsub('*','__/').gsub(' ','   ')};
    var offset = txt.len.of {|i| " " * (shift.abs * (i+1)) };
    shift < 0 && offset.reverse!;
    (offset »+« txt).join("\n");
}

say banner3D(text);
