Created
December 28, 2015 03:23
-
-
Save LindseyB/47e0d00e2d7bec8c7251 to your computer and use it in GitHub Desktop.
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
# 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