Created
September 27, 2015 07:03
-
-
Save kdefliese/c06ca283a7f4fddd65ef to your computer and use it in GitHub Desktop.
Homework for 9/25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "What do YOU want now?!" | |
reply = gets.chomp.upcase | |
puts "WHAT DO YOU MEAN, #{reply}?! YOU'RE FIRED!" | |
puts "Table of contents".center(40) | |
puts | |
puts "Chapter 1: ".ljust(10) + "Getting started" + "page 1".rjust(11) | |
puts "Chapter 2: ".ljust(10) + "Letters" + "page 10".rjust(20) | |
puts "Chapter 3: ".ljust(10) + "Numbers" + "page 20".rjust(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice work! Consider pulling your ljust and rjust lengths out into their own variables. That way, you only have to change the value once, rather than three times.