An interpreter for brainfuck, and a compiler from a minimal C-like language to brainfuck.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

79 lines
1.1 KiB

COMPAR :
========
<[
>[->+>+<<]>>[-<<+>>] on copie
+<[>-<[-]] on teste
>[->+>+<<]>>[-<<+>>]
<[<<<<[-]+>+>>>-] si le test est valide on efface
<<<-<-on finit la boucle
]
{add the last part}
Situation à la fin:
0 b 0 k
EQUALS :
+>[<->[-]]>>[<<<->>>-]<<<
DIFFERENT :
>[<+>[-]]>>[<<<+>>>-]<<<
GREATER :
>[-]>>[<<<+>>>-]<<<
GREATER OR EQUALS :
+>[<->[-]]>>[-]<<<
SMALLER :
>[<+>[-]]>>[-]<<<
SMALLER OR EQUALS :
+>[-]>>[<<<->>>-]<<<
MUL :
=====
<[->>+<<]>[->[-<<+>>>+<]>[-<+>]<<]>[-]<<
DIV :
=====
[->+>>+<<<]
<[->+>>+<<<]
>>>
[>[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[->+>+<<]>>[-<<+>>]<[<<<<[-]+>+>>>-]<<<-<-]+>[<->[-]]>>[-]<<<
[
-<[-<->>+<]>[-<+>]
<<<+>
[->>+>+<<<]>>>[-<<<+>>>]<<
[->>+>+<<<]>>>[-<<<+>>>]<
<[>[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[->+>+<<]>>[-<<+>>]<[<<<<[-]+>+>>>-]<<<-<-]+>[<->[-]]>>[-]<<<
]
<[-]<[-]<
MOD :
=====
[->+>>+<<<]
<[->+>>+<<<]
>>>
[>[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[->+>+<<]>>[-<<+>>]<[<<<<[-]+>+>>>-]<<<-<-]+>[<->[-]]>>[-]<<<
[
-<[-<->>+<]>[-<+>]
<<
[->>+>+<<<]>>>[-<<<+>>>]<<
[->>+>+<<<]>>>[-<<<+>>>]<
<[>[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[->+>+<<]>>[-<<+>>]<[<<<<[-]+>+>>>-]<<<-<-]+>[<->[-]]>>[-]<<<
]
<[-]<[-<+>]<