-
Notifications
You must be signed in to change notification settings - Fork 0
Binary
CrocBlanc edited this page Sep 1, 2025
·
2 revisions
see import
local bin = dofile("binary.lua")
OR
local bin = import("https://raw.githubusercontent.com/CrocBlancYT/computer-craft-libraries/refs/heads/main/src/binary.lua")local b = bin.new{true, false, ...}local b = bin.fromNumber(128)
OR
local b = bin.fromNumber(0x80)local b = bin.fromCharacter("z")local div2 = b:shift(-1)local not_b = b:invert()local char = b:toCharacter()local number = b:toNumber()local save = b:toSave()
-- {__type == "binary", [i] = b[i]}local add = b1 + b2
local sub = b1 - b2
local b1_and_b2 = b1 * b2
local b1_xor_b2 = b1 / b2{[1] = true | false ..}