Search code examples
rubyformattingscite

Make level the printed symbols in the ouput


Consider this Ruby code:

puts "*****"
puts "    *"
puts "     "
puts "*****"
puts "       *"

My Output is like this:

*****  
  *

*****
    *

Why the heck a whitespace doesn't fill the same space as * character in Scite? I've tried it in Eclypse with Java and it works just fine.


Solution

  • Proportional fonts have characters of varying widths, ruining space-based alignment.

    Switch to a monospace font (e.g., Courier) so all characters are the same size and it'll work.