Thursday 5 December 2013

Learn Ruby Language and Be an exploit coder-8

Printing, Printing

  • formatter = "%s %s %s %s"

  • puts formatter % [1, 2, 3, 4]
  • puts formatter % ["one", "two", "three", "four"]
  • puts formatter % [true, false, false, true]
  • puts formatter % [formatter, formatter, formatter, formatter]
  • puts formatter % [
  •     "I had this thing.",
  •     "That you could type up right.",
  •     "But it didn't sing.",
  •     "So I said goodnight."
  • ]

What You Should See.


  • $ ruby exploit8.rb
  • 1 2 3 4
  • one two three four
  • true false false true
  • %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s
  • I had this thing. That you could type up right. But it didn't sing. So I said goodnight.

Extra Credit.

Do your checks of your work, write down your mistakes, try not to make them on the next exercise.

No comments:

Post a Comment