brainfuck/op.bf

80 lines
1.1 KiB
Brainfuck
Raw Permalink Normal View History

2019-09-05 20:49:12 +02:00
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
2019-09-05 20:49:12 +02:00
EQUALS :
+>[<->[-]]>>[<<<->>>-]<<<
DIFFERENT :
>[<+>[-]]>>[<<<+>>>-]<<<
GREATER :
>[-]>>[<<<+>>>-]<<<
2019-09-05 20:49:12 +02:00
GREATER OR EQUALS :
+>[<->[-]]>>[-]<<<
2019-09-05 20:49:12 +02:00
SMALLER :
>[<+>[-]]>>[-]<<<
2019-09-05 20:49:12 +02:00
SMALLER OR EQUALS :
+>[-]>>[<<<->>>-]<<<
2019-09-05 20:49:12 +02:00
MUL :
=====
<[->>+<<]>[->[-<<+>>>+<]>[-<+>]<<]>[-]<<
DIV :
=====
[->+>>+<<<]
<[->+>>+<<<]
>>>
[>[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[->+>+<<]>>[-<<+>>]<[<<<<[-]+>+>>>-]<<<-<-]+>[<->[-]]>>[-]<<<
2019-09-05 20:49:12 +02:00
[
-<[-<->>+<]>[-<+>]
<<<+>
[->>+>+<<<]>>>[-<<<+>>>]<<
[->>+>+<<<]>>>[-<<<+>>>]<
<[>[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[->+>+<<]>>[-<<+>>]<[<<<<[-]+>+>>>-]<<<-<-]+>[<->[-]]>>[-]<<<
2019-09-05 20:49:12 +02:00
]
<[-]<[-]<
MOD :
=====
[->+>>+<<<]
<[->+>>+<<<]
>>>
[>[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[->+>+<<]>>[-<<+>>]<[<<<<[-]+>+>>>-]<<<-<-]+>[<->[-]]>>[-]<<<
[
-<[-<->>+<]>[-<+>]
<<
[->>+>+<<<]>>>[-<<<+>>>]<<
[->>+>+<<<]>>>[-<<<+>>>]<
<[>[->+>+<<]>>[-<<+>>]+<[>-<[-]]>[->+>+<<]>>[-<<+>>]<[<<<<[-]+>+>>>-]<<<-<-]+>[<->[-]]>>[-]<<<
]
<[-]<[-<+>]<