Created
December 6, 2022 23:39
-
-
Save chubbc/4b8ea2091e8cc6642b3a867237c00fe6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+++>+>>,>,>,<<<< initialise out to 3 / cnt to 1 / read in the first 3 value | |
[ loop until the cnt is 0 | |
<+> increment out by 1 | |
[-]++++++ set count to 6 | |
> [-] >[-<+>] >[-<+>] >[-<+>] , <<<< shuttle everything along and read new element | |
> [->>>>+>+<<<<<] >>>>>[-<<<<<+>>>>>] <<<<<< move a into place | |
>> [->>>>+>+<<<<<] >>>>>[-<<<<<+>>>>>] <<<<<<< move b into place | |
>>>>>> [-<->]<[[-]<<<<<->>>>>] <<<<< neq | |
> [->>>>+>+<<<<<] >>>>>[-<<<<<+>>>>>] <<<<<< move a into place | |
>>> [->>>+>+<<<<] >>>>[-<<<<+>>>>] <<<<<<< move c into place | |
>>>>>> [-<->]<[[-]<<<<<->>>>>] <<<<< neq | |
> [->>>>+>+<<<<<] >>>>>[-<<<<<+>>>>>] <<<<<< move a into place | |
>>>> [->>+>+<<<] >>>[-<<<+>>>] <<<<<<< move d into place | |
>>>>>> [-<->]<[[-]<<<<<->>>>>] <<<<< neq | |
>> [->>>+>+<<<<] >>>>[-<<<<+>>>>] <<<<<< move b into place | |
>>> [->>>+>+<<<<] >>>>[-<<<<+>>>>] <<<<<<< move c into place | |
>>>>>> [-<->]<[[-]<<<<<->>>>>] <<<<< neq | |
>> [->>>+>+<<<<] >>>>[-<<<<+>>>>] <<<<<< move b into place | |
>>>> [->>+>+<<<] >>>[-<<<+>>>] <<<<<<< move d into place | |
>>>>>> [-<->]<[[-]<<<<<->>>>>] <<<<< | |
>>> [->>+>+<<<] >>>[-<<<+>>>] <<<<<< move b into place | |
>>>> [->>+>+<<<] >>>[-<<<+>>>] <<<<<<< move d into place | |
>>>>>> [-<->]<[[-]<<<<<->>>>>] <<<<< | |
] | |
[-]>[-]>[-]>[-]>[-]<<<<< [->>+<<]>> clean up | |
print out the number | |
>+[[-]<[->+<[->+<[->+<[->+<[->+<[->+<[->+<[->+<[->+<[->[-]>>+>+<<<]]]]]]]]]<]>>[>]++++++[-<++++++++>]>>]<<<[.[-]<<<] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment