1. print "(R)ock, (S)cissors, (P)aper? "
  2. s = gets.strip.capitalize
  3. if s == "R"
  4. user_choice = :rock
  5. elsif s == "S"
  6. user_choice = :scissors
  7. elsif s == "P"
  8. user_choice = :paper
  9. else
  10. puts "Can't understand what you want, sorry..."
  11. exit
  12. end
  13. arr = [:rock, :scissors, :paper]
  14. computer_choice = arr[rand(0..2)]
  15. if computer_choice == user_choice
  16. puts "Nobody wins"
  17. end