Skip to content

Instantly share code, notes, and snippets.

@JuanjoSalvador
Last active September 7, 2018 20:00
Show Gist options
  • Select an option

  • Save JuanjoSalvador/c6839a0b06ae0615d6639be0b1342eab to your computer and use it in GitHub Desktop.

Select an option

Save JuanjoSalvador/c6839a0b06ae0615d6639be0b1342eab to your computer and use it in GitHub Desktop.
Generador de quinielas al azar. Ejemplo en Codepad http://codepad.org/FFdI8XyL
#!/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