Aer/tests/data/brainfuck/array.bf
belliash 5bfa60724a
All checks were successful
The build was successful.
Add new test - brainfuck interpreter.
2019-04-05 08:07:06 +02:00

22 lines
698 B
Brainfuck

>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
<<<<<<<<<<
first put the desired index in front of the array
++++
we are done if there is a zero in the current tag cell
[
decrement the current tag cell
-
move the value in the current tag cell to the next if it is not zero
[>>+<<-]
move to next tag cell
>>
we found it: print the desired element
]>.
now print another
<<<<<<<<<
++
[-[>>+<<-]>>]>.