Skip to content

Instantly share code, notes, and snippets.

@troyleach
Created January 21, 2015 22:14
Show Gist options
  • Select an option

  • Save troyleach/d54aeb9f93c73e058af5 to your computer and use it in GitHub Desktop.

Select an option

Save troyleach/d54aeb9f93c73e058af5 to your computer and use it in GitHub Desktop.
screencast #9
=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]
@markeban

Copy link
Copy Markdown

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment