fig cheat sheet

license: creative commons cc0 1.0 (public domain)


-- variables --

note: colons ":" are
optional and cosmetic.

the variable starting most
lines is the "main var." and
other commands affect it.

# set x to 0
# set x to 5
x 5
# set x to 5
x : 5
# set x to "hello there"
x : "hello there"
# x to 0, make array
x : arr


-- input --

# affects main var:
timer arrstdin
lineinput flineinput
time arropen file
date arrcurl url

# no effect on m. var:
sleep seconds


-- output --

# no effect on m. var:

print prints fprint
display cls
*graphics *textmode
colortext colorcode
highlight colorcode
locate row col
pset x y color
line x1 y1 x2 y2 color

* = must be on own line
(no effect on m. var)

-- loops --

*while *break

*for ct start stop step
*forin itemvar array

* = must be on own line
(no effect on m. var)


-- conditionals --

*iftrue ckvar
*ifequal ckequ1 ckequ2
*ifmore ckmore ckless
*ifless ckless ckmore

*try *except *resume


-- functions --

*function name p1? p2...
get copythisparameter

* = must be on own line
(no effect on m. var)

#affects main var:

lcase ucase str shell
asc val len not
ltrim rtrim chr
arrshell arreverse
reverse arrsort

left numberofchars
right numberofchars
arrget array position
arrset position setto
mid position len
string len ascii/string
split string splitby
join string with
instr lookin lookfor

#no effect on m. var:

chdir system close end
open "r"or"w"
return var
swap var1 var2

-- basic math --

note: math is done ordered left-to-right; traditional + / - * are planned command aliases

#affects main var:

plus numeric/string/arr
minus numeric
divby numeric
times numeric
note: times can concat
strings and arrays also

oct hex cos sin tan
atn int abs sgn sqr

mod denominator
topwr power

randint smallst largst


-- colorcodes --

note: see -- output --
section for colortext
and highlight commands

0 black 8 gray
1 blue 9
2 green 10
3 cyan 11 l.cyan
4 red 12
5 magenta 13 l.magenta
6 brown 14 yellow
7 white 15 b.white

background colorcodes:

0 black
1 blue
2 green
3 cyan
4 red
5 magenta
6 brown
7 white