Last active
September 7, 2018 20:00
-
-
Save JuanjoSalvador/c6839a0b06ae0615d6639be0b1342eab to your computer and use it in GitHub Desktop.
Generador de quinielas al azar. Ejemplo en Codepad http://codepad.org/FFdI8XyL
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
| #!/usr/bin/env ruby | |
| resultados = ["1", "x", "2"]; | |
| 30.times do |i| | |
| i = i + 1 | |
| if (i < 10) | |
| i = "0" + i.to_s | |
| end | |
| puts "Resultado " + i.to_s + ": " + resultados[rand(3)].to_s | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment