Created
December 11, 2021 21:09
-
-
Save CristianoBarone/c3b0776968c53131e045b8c8608b892e to your computer and use it in GitHub Desktop.
Fibonacci's sequence up to 233 in BrainFuck
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
Fibonacci's Sequence | |
>+. Print 1 | |
[<->>+<+<] | |
>.[>>+>+<<<-] Print 2 | |
>[->+<] | |
>.[-<<+>>] Print 3 | |
<<[<+>>+<-] | |
>[->>+<<<]> | |
>>[-<<+>>] | |
<<. Print 5 | |
[>+>+<<-] | |
<< | |
[->>>+<<<] | |
>>>. Print 8 | |
>[-<<+>>] | |
<[<<+<+>>>-]<<< | |
[ | |
[->>+<<] | |
>>. Print from 13 to 233 (attempting to go on from 233 will cause an overflow as we're working with 8bit unsigned ints) | |
[-<<+>>] | |
<<[>+>+<<-]> | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minified version:
+.>+.[<->>+<+<]>.[>>+>+<<<-]>[->+<]>.[-<<+>>]<<[<+>>+<-]>[->>+<<<]>>>[-<<+>>]<<.[>+>+<<-]<<[->>>+<<<]>>>.>[-<<+>>]<[<<+<+>>>-]<<<[[->>+<<]>>.[-<<+>>]<<[>+>+<<-]>]