Created
October 13, 2014 10:32
-
-
Save Papillard/6e3708596071a3ea0648 to your computer and use it in GitHub Desktop.
Loto interface for Re-Boot challenge @lewagon
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
def pick_number() | |
puts "pick a number please" | |
gets.chomp.to_i | |
end | |
def display_grid(grid) | |
grid.each_with_index do |num, index| | |
puts "Numero #{index + 1} => #{num}" | |
end | |
end | |
loto_grid = (1..10).to_a.shuffle.take(3) | |
my_grid = [] | |
3.times { my_grid << pick_number() } | |
puts "Your grid:" | |
display_grid(my_grid) | |
puts "The winning grid:" | |
display_grid(loto_grid) | |
loto_result(my_grid, loto_grid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
quel talent!