Last active
August 29, 2015 14:18
-
-
Save AngusP/7e16d1492550c07ad801 to your computer and use it in GitHub Desktop.
Fiiiiish BUUUUUsssh
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
thingy :: Integer -> IO() | |
thingy num = fb num 1 | |
where | |
fb :: Integer -> Integer -> IO() | |
fb stop n | |
| n > stop = putStrLn "" | |
| (mod n 3) == 0 && (mod n 5) == 0 = do | |
putStrLn "FISSSSSHBUSSSHH!" | |
fb stop (n+1) | |
| (mod n 3) == 0 = do | |
putStrLn "fissshhhhhh" | |
fb stop (n+1) | |
| (mod n 5) == 0 = do | |
putStrLn "bUUUUUsh" | |
fb stop (n+1) | |
| otherwise = do | |
putStrLn $ show n | |
fb stop (n+1) |
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
def fb(n): | |
for i in range(1,(n+1)): | |
if((i % 3) == 0 or (i % 5) == 0): | |
if(i % 3): | |
print "Fiiiiishh" | |
if(i % 5): | |
print "Buuuuush" | |
elif (((i % 3) ==0) and ((i % 5) ==0)): | |
print "FFFFIIIIIIISHHHHHBUSSSSSSHHHH!!!" | |
else: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment