Skip to content

Instantly share code, notes, and snippets.

@ArronJLinton
Last active May 18, 2017 04:59
Show Gist options
  • Select an option

  • Save ArronJLinton/caf6f587d3d102724848abb7099df3ef to your computer and use it in GitHub Desktop.

Select an option

Save ArronJLinton/caf6f587d3d102724848abb7099df3ef to your computer and use it in GitHub Desktop.
// Tutorials
https://www.railstutorial.org/
https://www.railstutorial.org/book
https://www.theodinproject.com/
https://tutorials.railsapps.org/
// Github
http://railsapps.github.io/
// Online Ruby On Rails Text Editor
https://c9.io/alinton12
Rock Paper Scissors Game
computer_choices = ["r", "p", "s"]
play = true
while play do
rcc = computer_choices.sample
puts "choose r, p or s"
uc = gets.chomp
if rcc == uc
puts "tied"
elsif (rcc == "r" and uc == 's') or (rcc == "p" and uc == 'r') or (rcc == "s" and uc == 'p')
puts "computer won"
else
puts "user won"
end
puts "want to play again? yes or no"
play = gets.chomp == "yes"
# if gets.chomp == "yes"
# play = true
# else
# play = false
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment