Create letters with ROR display on cmd

How can you alter the following code to replicate the letters ‘G’ and ‘X’ into your command prompt using ROR? I was able to create the letter H to display on my cmd.

Draw top Region 1

for y in 1..8
  for x in 1..6
    print "*"
  end

  for x in 1..8
    print " "
  end

  for x in 1..6
    print "p"
  end

  print "\n"
end

``

Draw center bar Region 2 goes all the way across the bar

Use a different character or different regions.

for y in 1…3
for x in 1…20
print “*”
end
print “\n”
end

``

Draw bottom bar Region 3 Look like the top bar

for y in 1…8
for x in 1…6
print “*”
end

  for x in 1..8
    print " "
  end

  for x in 1..6
    print "*"
  end

  print "\n"
end

``

if you go that route, you may have problems editing the letters. imc, i actually created a drawing / image of all the letters in a text file, then compress / decompress the file when needed. i arranged the letters in a column, one big letter-width-wise column ie, because it was easier for me to edit the letters and i can visibly see if they align or go out of bounds/edges.

there are vector-based-like version of this; see figlet and artii gems eg.

kind regards --botp

There is a program, banner(1), on a lot of unix systems that does this. So either you might not want to do it in Ruby (because this does it already), e.g.,

banner -w 40 Hello, World

Or you can look at its source and see how it does it: http://www.opensource.apple.com/source/text_cmds/text_cmds-9/banner/chset.c contains encoding of the letters and then http://www.opensource.apple.com/source/text_cmds/text_cmds-9/banner/banner.c uses it. It goes further by correctly printing drop characters like j, p, q, etc.

HTH,

Paul