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.
 
 
 
 

57 lines
775 B

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