Array.include? question

hey all,

I am playing with ruby a little bit and I wrote a small game, it seems
to break at this module:

def random_punishment()
odd = 1, 3, 5]

puts “Your punishment will be chosen at random”
puts “I will now roll the dice of doom, pick your number”

prompt; choice = gets.chomp.to_i

if odd.include? choice
puts “you are now going to be burned and flayed, here’s some BBQ
sauce”
else
random_punishment()
end
end

I only the else option gets chosen, and I am not sure how to fix it. Any
suggestions?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs