This file contains hidden or 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
>>,[ | |
[[>>]++[-<<]>>] | |
++++++++[>[>-<-]>[<+>+[-]]<<-[>>+<<-]+>>] | |
<[-< | |
<[-< | |
<[-< | |
<[-< | |
<[-< | |
<[-< | |
<[-< |
This file contains hidden or 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
[day9a.b -- 2022 Advent of Code Day 9 Part 1 | |
(c) 2022 Daniel B. Cristofani | |
http://brainfuck.org/ | |
This program is licensed under a Creative Commons Attribution-ShareAlike 4.0 | |
International License (http://creativecommons.org/licenses/by-sa/4.0/).] | |
[This program solves Advent of Code 2022, Day 9, Part 1. | |
(https://adventofcode.com/2022/day/9/) | |
Basic data layout is, roughly: |
This file contains hidden or 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
[siercarpet.b -- Sierpinski Carpet | |
(c) 2021 Daniel B. Cristofani | |
http://brainfuck.org/] | |
>-->->->>>>>(>>>>>>>>>)+++++[>++++++<-]>+[>+>+++<<-]>+[ | |
[<]<++[<++]--<[>>[-->]>..<<<]>>[[-->]>>--.++.<<]<<<<<<<+[ | |
[--->++++++<[+++>--------->>[->>>]->>>]+<<<+] | |
>[<->>>[->>>]++++++++++.[-]<<+>+++[-]]< | |
]>>>->> | |
] |
This file contains hidden or 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
Ook! Ook! Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook? Ook |
This file contains hidden or 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
[life.b -- John Horton Conway's Game of Life | |
(c) 2021 Daniel B. Cristofani | |
http://brainfuck.org/] | |
>>>->+>+++++>(++++++++++)[[>>>+<<<-]>+++++>+>>+[<<+>>>>>+<<<-]<-]>>>>[ | |
[>>>+>+<<<<-]+++>>+[<+>>>+>+<<<-]>>[>[[>>>+<<<-]<]<<++>+>>>>>>-]<- | |
]+++>+>[[-]<+<[>+++++++++++++++++<-]<+]>>[ | |
[+++++++++brainfuck.org-------->>>]+[-<<<]>>>[>>,----------[>]<]<<[ | |
<<<[ | |
>--[<->>+>-<<-]<[[>>>]+>-[+>>+>-]+[<<<]<-]>++>[<+>-] |
This file contains hidden or 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
>,>+>>>,+<++++++++[<<<------>>>>------<-]>-[+<]<<[>]<[ | |
<[ | |
->>>>[ | |
<+[->-[[>>]>-<]++++++++++>+]<[-]<<-[+>>]<< | |
[[>>+<<-]<<] | |
<<[>+<-]->[<+>>+<-]+>>+>>>> | |
]<<<[ | |
>>>++<< | |
] | |
]>[ |
This file contains hidden or 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
[How to do functions in brainfuck. | |
Okay. We'll translate the following program into brainfuck, with no thought of efficiency: | |
char fib (char a){ | |
switch(a): | |
case 0: return 0 | |
case 1: return 1 | |
default: return fib(a-2)+fib(a-1) | |
} |
This file contains hidden or 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
--->--->>>>->->->>>>>-->>>>>>>>>>>>>>>>>>+>>++++++++++[ initialization | |
<<++[ output board | |
--<+<<+<<+>>>>[ | |
>[<->>+++>>[-]<<<+[<++>>+>>-<<<--]]+>+++++[>>++++++++++<<-] | |
>>-.[-]>>+[<<<<+>>+>>-]<<<<<<[>+<-]<< | |
]++++++++++.[-]>++ | |
]-->>[-->[-]>]<<[ if game not over | |
>>--[ while stack isn't empty | |
-[ | |
-[ fn 0: get move from user |
This file contains hidden or 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
=256 R +4 . +1 | |
:2 | |
=2 . . . =0 . . | |
-256 *5 ! | |
-0 +7 . . +6 . . . *5 ! | |
-0 W *3 ! | |
-0 *8 ! | |
-0 +9 . . *3 :5 | |
-256 =1 +3 ~ |
This file contains hidden or 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
+7 +4 +3 :10 | |
=2:2 | |
=3:3 | |
=4:4 | |
=5:5 | |
=6:6 | |
=7:7 | |
=8:8 | |
=9:9 | |
-8 =120 +12 *11 . =151 *11 . =47 *11 -3 $ *3 -7 $ *7 . -0 *8 :13 |
NewerOlder