Anonymous user
Execute Brain****/Standard ML: Difference between revisions
m
Categorization now in master page
(translated from haskell) |
m (Categorization now in master page) |
||
Line 1:
{{implementation|Brainf***}}{{collection|RCBF}}
Quick implementation of a [[Brainfuck]] interpreter in [[Standard ML]].
Like the [[Haskell]] [[RCBF/Haskell|version]] but without the lazy lists:
Pairs of lists are used to implement both the two-side infinite band of cells, and the program storage.
Line 43:
| exec (p as (_, #"]"::_), d ) = exec (matchLeft (moveLeft p), d)
fun run s = exec (([], s), ([0], [0]))</lang>
Example output:
|