Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- title = "Table of Contents"
- bookinfo = ["Numbers", 1, "Letters", 72, "Variables", 118]
- width = 50
- puts bookinfo.join(", ")
- puts title.center(width)
- 3.times do |ch|
- puts(("Chapter #{(ch + 1).to_s}: " + bookinfo[2*ch].to_s).ljust(width/2) + ("page " + bookinfo[(2*ch)+1].to_s).rjust(width/2))
- end
Add Comment
Please, Sign In to add comment