Skip to content

Instantly share code, notes, and snippets.

@AngusP
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AngusP/7e16d1492550c07ad801 to your computer and use it in GitHub Desktop.
Save AngusP/7e16d1492550c07ad801 to your computer and use it in GitHub Desktop.
Fiiiiish BUUUUUsssh
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)
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