Created
January 21, 2015 22:14
-
-
Save troyleach/d54aeb9f93c73e058af5 to your computer and use it in GitHub Desktop.
screencast #9
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
| =begin | |
| # => Create a program that asks a user to enter four random words, one at a time. Then, | |
| # => the computer will ask the user to choose a number between 1 and 4. | |
| # => The computer will then display the word corresponding to the correct number. | |
| For example, if the user typed in the words ghost, umbrella, candy, and pepperoni in that order, if the user then chooses the number 2, the computer displays the second word, which in this example is umbrella. | |
| =end | |
| #screencast 9 | |
| # puts "Please enter 4 random words, any words" | |
| # words = [] | |
| # 4.times do | |
| # puts "Enter a Word" | |
| # words << gets.chomp | |
| # end | |
| # puts "Please enter a number between 1 and 4" | |
| # number = gets.chomp.to_i | |
| # puts words[number - 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect!