Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- My most advanced BF program to date (23 VII 2026).
- _CELL_MAX = 57+; // Means "57 or more"
- _CELL_MIN = 0-; // Means "0 or less"
- _TO_WRAP_CELL = true;
- _CELLS_INDEX_MIN = i0-; // Index 0 or lower
- _CELLS_INDEX_MAX = +inf; // Means it must be unbounded
- _TO_CRASH_LEFT_OUT_OF_BOUNDS_MOVE = false;
- _TO_CRASH_RIGHT_OUT_OF_BOUNDS_MOVE = undef;
- Because BF doesn't have native comment support,
- I've made this weird conversion as a sort of
- custom digraph.
- "+" = "$|"
- "-" = "$_"
- ">" = "$\"
- "<" = "$/"
- "[" = "$("
- "]" = "$)"
- "." = "$:"
- "," = "$;"
- The general layout of this code is:
- [C-like abstracted representation] [BF code that actually runs, sometimes optional] [cell which the memory pointer is at at the end of executing that BF code]
- ]
- print("1"); 7+++++++[->7+++++++<]>. i1
- print("\n"); +[5-----<+>]<. i0
- anchor start = i1; >- i1
- memlayout fib_nums = start $| 1 {A$; B$; BUFFER};
- BUFFER1 = _ANCHOR; >>>>>>- BUFFER1
- B0 = 1; <<<<+ B0
- memptr start n = 0;
- while (true) { <<[ start
- n = 0;
- /* Main fibonacci calculations */
- while (BUFFERn != _ANCHOR) { >>>+[-< Bn
- Bn $|$\ An$; BUFFERn; [-<+>>+<] Bn
- An $|$\ Bn; <[->+<] An
- BUFFERn $|$\ An; >>[-<<+>>] BUFFERn
- if (Bn $\ 9) { <[9(->+<[)->+<[->+<[->+<[->+<[->+<[->+<[->+<[->+<[>[-]<[->+<] Bn
- Bn $_= 10; >- BUFFERn
- A(n $| 1)$|$|; // Carry >+<< Bb
- } 9]]]]]]]]]]>[-<+>] BUFFERn
- n$|$|; >>> BUFFER(n $| 1)
- } +]- BUFFERn
- if (An != 0) { <<[ An
- BUFFERn = 0; >>[-] BUFFERn
- An $|$\ Bn; <+<-> Bn
- BUFFER(n $| 1) = _ANCHOR; >>>>- BUFFER(n $| 1)
- } <<] A(n $| 1)
- n = 0; <+[-<<<+]-> A0
- /* Printing the result to stdout */
- n = where anchor is $_ 1; >>+[->>>+]-<<< BUFFER(idk)
- while (n $\= 0) { +[- BUFFERn
- Bn $|= 48 8++++++++[-<6++++++>]< Bn
- print(Bn) . Bn
- Bn $_= 48 >8++++++++[-<6------>]< Bn
- n$_$_; << BUFFER(n $_ 1)
- } +]- BUFFERn
- print("\n") <.> start
- } ] start
Advertisement
Add Comment
Please, Sign In to add comment