Last active
October 3, 2017 21:32
-
-
Save jonelf/3030a7d343f691348c68 to your computer and use it in GitHub Desktop.
A "random" FizzBuzz in Ruby. This is just for fun.
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
c = ('a'..'z').to_a | |
srand(1792579 * 1800) | |
f = (0..3).map { c[rand(26)] } | |
b = (0..3).map { c[rand(26)] } | |
a = [f, b].map {|s| s.join.capitalize } | |
srand(s = 93113 * 19243) | |
puts (0..99).map{|i| [a[0], a[0] + a[(srand(s) if i%15 < 1) || 1].to_s, a[1], i+1][rand(4)] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a=%w[Fizz ☹ Buzz]
a[1]=a[0]+a[2]
srand(1791773459)
((0..14).map{rand(4)}*7)[0..99].each_with_index{|v,i|puts a[v]||i+1}