Pico-8 API Documentation
Operators
Operators
Bitwise
x & y -- both bits are setx | y -- either bit is setx ^^ y -- either bit is set, but not both of them~ x -- each bit is not setx << n -- shift left n bits (zeros come in from the right)x >> n -- arithmetic right shift (the left-most bit state is duplicated)x >>> n -- logical right shift (zeros comes in from the left)x <<> n -- rotate all bits in x left by n placesx >>< n -- rotate all bits in x right by n placesBitwise functions
band(x, y) -- both bits are setbor(x, y) -- either bit is setbxor(x, y) -- either bit is set, but not both of thembnot(x) -- each bit is not setshl(x, n) -- shift left n bits (zeros come in from the right)shr(x, n) -- arithmetic right shift (the left-most bit state is duplicated)lshr(x, n) -- logical right shift (zeros comes in from the left)rotl(x, n) -- rotate all bits in x left by n placesrotr(x, n) -- rotate all bits in x right by n placesAssignment
a = b -- seta + b -- suma - b -- suba * b -- mula / b -- diva \ b -- int div; ie: flr(x)/na % b -- moda ^ b -- powAugmented Assignment
a += b -- sum toa -= b -- sub toa *= b -- mul toa /= b -- div toa %= b -- mod toa ^= b -- pow toRelational
a == b -- equivalenta ~= b -- non-equivalenta != b -- non-equivalenta > b -- greatera < b -- lessa >= b -- greater or equivalenta <= b -- less or equivalentBoolean
not a -- negationa and b -- conjunctiona or b -- disjunctionDelimiters
(a)