Created
February 18, 2013 18:53
-
-
Save anonymous/4979674 to your computer and use it in GitHub Desktop.
Random list matcher
This file contains 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
x = Array.new | |
puts "Enter names:" | |
y = '' | |
while y !=#nill | |
y = gets.chomp | |
x.push y.capitalize | |
end | |
x.delete ('') | |
w = Array.new | |
puts "Enter dates:" | |
z = '' | |
while z !=#nill | |
z = gets.chomp | |
w.push z | |
end | |
w.delete ('') | |
one_len = x.length | |
two_len = w.length | |
rand1 = rand(one_len) | |
rand2 = rand(two_len) | |
phrase = x[rand1] + " will present on the " + w[rand2] | |
puts phrase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment