editor.🍌
output
🍌 BananaScript interpreter ready.
Write some code and press RUN, or load an example.
Language Reference
peel x = 5
Declare a variable
peel name = "Cavendish"
mash expr
Print to output
mash "Hello, World!"
ripe / spoiled / else
If / else if / else
ripe x > 0 { mash "positive" }
bunch n times { }
Repeat n times
bunch 5 times { mash "🍌" }
while cond { }
While loop (use
while)while x < 10 { peel x = x + 1 }
plantain fn(a, b) { }
Define a function
plantain add(a, b) { harvest a + b }
harvest expr
Return from a function
harvest x * 2
slip
break out of loop
ripe x == 5 { slip }
// comment
Single-line comment
// this is potassium-rich
mushy / firm
Boolean true / false
peel ripe = mushy
smoothie(a, b, ...)
String concatenation
mash smoothie("Hi ", name)
len(x)
String or array length
mash len("banana")