- Replace
is
with's
(removing the leading whitespace) n's-
is the shortest way to initialize a variable to one.- Some operators like
+
take multiple arguments, so you can abuse it likes+" "i
instead ofs+" "+i
turn up
/turn down
to round- To get x remainder y:
t = x/y
,turn down t
,x-t*y
is the remainder - Or to just check for divisibility, you can use
turn up
instead
- To get x remainder y:
- In
rock x with y
, the with is unneeded,rock x y
works cut
can split by an int, likecut "a0b0c"with 0into x
- Steal stuff from Java:
off java,math play BigDecimal
means
to alias: e.g. you usetaking
a lot to call a function, uset means taking
and then uset
Rounding
x+8e15-8e15
to round to the nearest integerx+8e15-8e15is x
to check ifx
is an integerx/y+8e15-8e15is x/y
to check ifx
is divisible byy
x/y*"a"y's x*"a"
does the same, but slower
Array operators
push x 2,3,4,5
t = x+6 (t = 2,3,4,5,6)
t = 1+x (t = 1,2,3,4,5)
t = x+x (t = 2,3,4,5,2,3,4,5)
t = x-2 (removes 2nd element: t = 2,3,5)
Any other arithmetic operation converts the array to its length:
t = 0-x (t = -4)
For each
while v
say pop v
is one byte shorter than
while v as x
say x
Into
t = x
cut t
is one byte shorter than
cut x into t