-
Notifications
You must be signed in to change notification settings - Fork 1
/
bf_interpreter.rasel
39 lines (38 loc) · 1.32 KB
/
bf_interpreter.rasel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
1-0v
>~v:W-:/?v1\01--
:
-
- >0@
v > >06--::3>-:3-?^::\
> 1\1-\1 ^ <
^>:"]"-:/?#v02\\v
>01--::01--\:"["-:/?v:"]"-:/?v1\\
^ > 1\\1\:?^1-1\01--
^ >1\\1\01--1\
\v <
^>:"["-:/?#v2\::\:?v1\1-\2
^ >1\1-\2\02\v
>\::1-1\\:"["-:/?v:"]"-:/?v1\1-
^ > 1\1-\1\01--1
^ >2\:?v1-2\1\1-
^v < >-1-1
2
^>:","-:/?#v2\:~v1\\:--
v < >"FOE" ,,,A,1@
^>:"."-:/?#v2\::\:,1\1-\
v <
^>:"<"-:/?#v2\1-::\:01--?v1\1-\
v < >"dne epat",,,,,,,,A,1@
^>:">"-:/?#v2\01--
v <
^>:"+"-:/?#v2\::\01-->G1G//%1\1-\
v <
>:"-"-:/?#v2\::\ 1-^
>"noitcurtsni dilavni" ,,,,,,,A,1@
* stdin is splitted into bf code and bf stdin delimeted by EOF or ' '
* exit codes (only 0 and 1 are possible)
* exit code 1 also prints the error message
* all possible cases of exit code 1
* read from EOF
* going to the negative tape address
* reaching an instruction other than [],.<>-+