Play demo
Bibi-binary's itch.io pageCompressed Bytes used
764
Source Code (OPTIONAL)
-- bibibinary
-- by @dredds
do
local function bibi(n,f)
local z
for i = 12,0,-4 do
local d = (n>>i)&0xf
if d~=0 or z or i==0 then
f(d)
z=true
end
end
end
local c1 = "hbkd"
local c2 = "oaei"
function bibi_name(n)
local s = ""
bibi(n,function(d)
s = s..c1[d\4+1]..c2[d%4+1]
end)
return s
end
local digits =
"ᵉ■■■ᵉ⁶⁸⁸⁸⁸⁸⁸⁸⁸⁶゛¹¹¹゛ᶜ²²²²ᵉ■■■■▮▮ᵉ¹¹▮「⁘□■²²²²ᶜ¹¹ᵉ▮▮■■■■ᵉ゜▮▮▮▮ᶠ▮▮▮ᶠ¹¹¹¹゜■\t⁵³¹■」‖⁙■"
function tobibi(n)
local s = ""
bibi(n,function(d)
local i = d*5+1
s = s..
"\^," ..
sub(digits,i,i+4) ..
"\0\0\0\-e"
end)
return s
end
end
function _init()
n = rnd(0x7fff)\1
end
function _draw()
cls(1)
color(7)
print("bibi-binary numbers",
2,2)
print("invented by robert \"boby\"",
2,16)
print("lapointe (1922-1972)",
2,24)
print("\f7decimal: \fa"..tostr(n),
2,48)
print("\f7hexadecimal: \fe" ..
sub(tostr(n,1),3,6),
2,56)
local x = print(
"\f7bibi digits: \fc" ..
tobibi(n),
2,72)
print(
"\f7pronounced: \fc"..
bibi_name(n) ..
"\f7",
2,80)
color(6)
print(
"⬆️⬇️ : +/- 1"..
" " ..
"⬅️➡️ : \^;0200070002000000\-c/* 2",
2,104)
print(" 🅾️ : zero",
2,112)
print(" ❎ : randomise",
2,120)
end
function _update()
if btnp(⬇️) then
n -= 1
elseif btnp(⬆️) then
n += 1
elseif btnp(⬅️) then
n \= 2
elseif btnp(➡️) then
n *= 2
elseif btnp(❎) then
_init()
elseif btnp(🅾️) then
n = 0
end
n = max(0,n)
end
Leave a comment
Log in with itch.io to leave a comment.
Comments
Nice, it'd be cool to take keyboard input, since you have the bytes left?
Very interesting. I didn’t know anything about this number system. Thank you very much 😊 Perhaps the best learning contribution to the PICO-1k Jam in BIDEKA
Cute!