Jump to content

Fractran: Difference between revisions

m
→‎Reading the program: (specialized a type signature slightly to enable compilation)
m (Minor linting of English grammar in task description (step -> steps))
m (→‎Reading the program: (specialized a type signature slightly to enable compilation))
Line 1,759:
Additional import
<lang Haskell>import Data.List.Split (splitOn)</lang>
<lang Haskell>readProgram :: String -> [Ratio aInt]
readProgram = map (toFrac . splitOn "/") . splitOn ","
where toFrac [n,d] = read n % read d</lang>
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.