One of the lesson's in Chris Pine's tutorial teaches the string methods center, ljust, and rjust.
Whitespace get collapsed though in output viewer so the student can't tell if their code is working.
line_width = 50
puts( 'Sat in her cupboard'.center(line_width))
Pine. Learn to Program, 2e (Doug Bradbury) (Kindle Locations 637-638). The Pragmatic Bookshelf (309187).
One of the lesson's in Chris Pine's tutorial teaches the string methods center, ljust, and rjust. Whitespace get collapsed though in output viewer so the student can't tell if their code is working.
line_width = 50 puts( 'Sat in her cupboard'.center(line_width)) Pine. Learn to Program, 2e (Doug Bradbury) (Kindle Locations 637-638). The Pragmatic Bookshelf (309187).