f n = if x >= 0 then x else (-1) - x where x = 3 - n `mod` 8 main = do print $ map f [0..20]
Standard input is empty
[3,2,1,0,0,1,2,3,3,2,1,0,0,1,2,3,3,2,1,0,0]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!