Advertisement
Guest User

Classy Porky

a guest
Jan 5th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.28 KB | None | 0 0
  1. class Porky
  2.     print "Please enter a sentence..."
  3.     user_input = gets.chomp()
  4.     user_input.downcase!
  5.         def intialize(user_input)
  6.             if user_input.include? "s"
  7.                     user_input.gsub!(/s/, "th")
  8.             else print "you thuck again"
  9.             end
  10.         end
  11.     puts "Porky pig says, #{user_input}!"
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement