CMC logo Cave Man Code

One page with everything. Print it, tape it to the cave wall.

Talking

Write thisIt does
oga <things>, <things>print on one line
blorp "question"ask the person, answer comes back as text
ugg anythinga note, ignored by the computer

Boxes

Write thisIt does
grunk x = 5make a new box
x = 6change an existing box
x = x + 1change it using its old value
gronk / norkyes / no
plopnothing
pi3.14159...
lapwhich booga lap you are on (magic)

Choices

binga check
    ...
wonga
    ...
unga
binga check
    ...
wonga binga other_check
    ...
wonga
    ...
unga

Logic

and &nbsp; or &nbsp; not &nbsp; == &nbsp; != &nbsp; < &nbsp; <= &nbsp; > &nbsp; >= &nbsp; in &nbsp; not in

Loops

Write thisIt does
booga 5 ... ungado it 5 times, lap counts 1..5
zug x < 10 ... ungawhile the check is gronk
zoop thing in pile ... ungaonce per thing in a pile or text

Clumps (functions)

clump name(a, b)
    oga a
    ork a + b
unga

oga name(1, 2)

Piles (lists)

Write thisIt does
snorf(1, 2, 3)make a pile
snorf()empty pile
plop(pile, x)add x to the end
nom(x)how many
pile[0]first thing (spots start at 0)
pile[-1]last thing
skoop(pile, 2)same as pile[2]
yoink(pile)take the last thing off
pile[1] = 9change a spot
x in pileis x inside?

Text

shout(t) whisper(t) flip(t) find(t, piece) split(t, sep) join(pile, sep) goop(x) nom(t) skoop(t, i) t[i]

Numbers

round(x) flat(x) roof(x) abs(x) small(a,b) big(a,b) root(x) pow(a,b) munga(a,b) numba(text)

Drawing

Write thisIt does
skrib size 400, 400set picture size
skrib color "red"pick a color (names or "#ff8800")
skrib dot x, y, rfilled circle
skrib circle x, y, routline circle
skrib line x1, y1, x2, y2a line
skrib box x, y, w, houtline rectangle
skrib blob x, y, w, hfilled rectangle
skrib write "words", x, ytext on the picture
skrib clearwipe the picture
wait(500)pause half a second

The spot 0, 0 is the top-left corner.

English mode

Every CMC word has an English twin you can mix in freely:

CMCEnglish
ogaprint, say
grunklet, make
bingaif
wongaelse
ungaend, done, finish
boogarepeat
zugwhile
zoopfor
clumpfn, function, def
orkreturn, give
blorpask
skribdraw
uggcomment
gronktrue
norkfalse
plopnothing

The shape of a program

ugg notes at the top
grunk boxes...
clump helpers...
ugg the actual work
booga / binga / zoop blocks
oga answers

Terminal commands

cmc                     talk to CMC (REPL)
cmc run hello.cmc       run a program
cmc compile hello.cmc   make hello.py
cmc init hello.cmc      make a starter program
cmc examples            list example programs

OGABOOGA CODER keys

F5 run &nbsp; Esc stop &nbsp; Ctrl+S save &nbsp; Ctrl+O open &nbsp; Ctrl+N new &nbsp; Ctrl+Z undo blocks