Runge-Kutta method: Difference between revisions

m
(→‎{{header|Haskell}}: Added an alternative draft, using a single scanl)
Line 897:
main :: IO ()
main =
(putStrLn . unlines) $
mapM_
(\(x, y, v) ->
putStrLn $unwords
[ "y" ++ justifyRight 3 ' ' ('(' : show (round x)) ++ ") = "
unwords
, justifyLeft [ "y" ++ justifyRight 319 ' ' ('(' : show (round xy)) ++ ") = "
, justifyLeft 19 ' ': (show y)v
]) , '±' : show v<$>
samples
])
samples
where
justifyLeft n c s = take n (s ++ replicate n c)
9,655

edits