Last active
May 18, 2017 04:59
-
-
Save ArronJLinton/caf6f587d3d102724848abb7099df3ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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