User:Salpynx/bf8

From Esolang
Jump to navigation Jump to search

Wiki math notation for some functions / formulas to help working with Brainfoctal.


'Length' in base n digits of a number x:


Octal digital length:


Repeat an octal digit x, n times:


FizzBuzz (or -4122 -8022)


gives

[1, 2, -4122, 4, -8022, -4122, 7, 8, -4122, -8022, 11, -4122, 13, 14, -41228022, 16, 17, -4122, 19, -8022, -4122, 22, 23, -4122, -8022, 26, -4122, 28, 29, -41228022, ...]


Python equivalent:

from math import floor, ceil
phi = -4122
beta = -8022
fb = lambda x: x * ceil(x/3 - x//3) * ceil(x/5 - x//5) + beta * (1 + floor(x//5 - x/5)) + phi * (1 + floor(x//3 - x/3)) * (1 + (1 + floor(x//5 - x/5)) * 9999)
[fb(i) for i in range(1, 31)]

Truth-machine

Where x = input value, r = output radix (suggested = 10), m = number of 'loops' (suggested = ∞ or 100)

Resources