Skip to content

Instantly share code, notes, and snippets.

@LindseyB
Created December 28, 2015 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LindseyB/47e0d00e2d7bec8c7251 to your computer and use it in GitHub Desktop.
Save LindseyB/47e0d00e2d7bec8c7251 to your computer and use it in GitHub Desktop.
# FizzBuzz by LindseyB where it sleeps if not divisible
define :fizzbuzz do
sample :elec_fuzz_tom, rate: 1
sample :ambi_soft_buzz, rate: 1
sleep 1
end
define :fizz do
sample :elec_fuzz_tom, rate: 2
sleep 0.5
end
define :buzz do
sample :ambi_soft_buzz, rate: 2
sleep 0.5
end
i = 0
100.times do
if (i%15 == 0)
fizzbuzz
elsif (i%3 == 0)
fizz
elsif (i%5 == 0)
buzz
else
sleep 1
end
i+=1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment