Padovan sequence: Difference between revisions

→‎{{header|Haskell}}: Added context to the preamble, applied HLint.
(→‎{{header|Haskell}}: Added context to the preamble, applied HLint.)
Line 880:
main = do
putStr "P_0 .. P_19: "
putStrLn $ unwords $ map show $ take 20 $ pRec
putStr "The floor- and recurrence-based functions "
Line 891:
putStr "The first 10 L-system strings are:\n"
putStrLn $ unwords $ take 10 $ lSystem
putStr "\nThe floor- and L-system-based functions "
Line 910:
 
 
and a variant expressed in terms of '''unfoldr''', which allows for a coherent treatment of these three cases – isolating the respects in which they differ – and also lends itself to a simple translation to the N-Step Padovan case, covered in another task.
and a variant expressed in terms of '''unfoldr''':
<lang haskell>import Data.List (unfoldr)
 
9,655

edits