Apelang operates on pure, unadulterated primate instinct. It's simple, it's raw, and it's surprisingly effective. Here are the tools at your disposal.
Note: This playground is a simplified simulation. It supports most of the core syntax but does not include advanced features like summon
, forage
, inscribe
, or tumble
/catch
blocks.
Core Concepts
- Variables & Types: Declare with
ape
. Basic types includenumber
,string
,boolean
(true
,false
), andnil
. - Comments: Use
#
to leave notes for other apes. - I/O: Print to the console with
tree
and get user input withask()
. - Thematic Operators: Perform arithmetic with
ooh
(+),aah
(-),eek
(*), andook
(/). - Functions (Tribes): Group code into reusable blocks with
tribe
. Usegive
to return a value.
Data Structures
- Bunch (Arrays): Create an ordered list of items:
ape myBunch = [1, "two", true]
. - Canopy (Maps): Create a key-value store:
ape myCanopy = {"food": "banana"}
.
Control Flow & Logic
- Conditionals: Use
if
/else
blocks. Combine conditions with logical operatorsripe
(AND) andyellow
(OR). - Loops: Use
swing
for a set number of repetitions andbanana
for while-style loops.