Hofstadter Figure-Figure sequences: Difference between revisions
Content added Content deleted
(→{{header|Haskell}}: Applied hlint hindent, adjusted one name to side-step Wiki formatting glitch) |
(→{{header|Haskell}}: Applied Hlint, hindent to second Haskell version) |
||
Line 980: | Line 980: | ||
<lang haskell>import Data.List (sort) |
<lang haskell>import Data.List (sort) |
||
r :: [Int] |
|||
r = scanl (+) 1 s |
r = scanl (+) 1 s |
||
⚫ | |||
⚫ | |||
⚫ | |||
s :: [Int] |
|||
⚫ | |||
where |
|||
⚫ | |||
⚫ | |||
main :: IO () |
|||
main = do |
main = do |
||
putStr "R: " |
|||
print (take 10 r) |
|||
putStr "S: " |
|||
print (take 10 s) |
|||
⚫ | |||
putStr "test 1000: " |
|||
⚫ | |||
output: |
output: |
||
<pre> |
<pre> |