← home · docs · github

examples — try them!

every file starts with SB. tap one, copy it, run sb examples/<name>.sb

hello.sb

the classic — 2 lines.

SB
say "Hello, ShimbaBomb!".
open →

math.sb

words, not symbols.

set y to 10 plus 5.
set z to 7 divided evenly by 2.
open →

fib.sb

recursion — still english.

define fib with n as
  if n is less than 2 then
    give back n.
  end
end.
open →

counter_app.sb

clicks + state.

shimgui_button with "+ 1".
set state["count"] to ...
shimgui_run with.
open →

shimgui_demo.sb

real GTK — stats + meters.

shimgui_stat with "COUNT" ...
shimgui_meter with ...
open →

shimgui_real_demo.sb

no html — pure GtkButton.

shimgui_window with "Real" ...
shimgui_label  ...
shimgui_button ...
open →

svm.sb

a VM *in* SB — countdown + fib(10).

PUSH 3 / STORE n / loop:
LOAD n / PRINT ...
open →

errors.sb

try/catch that actually helps.

try
  set y to 10 minus "oops".
catch e
  say e_info["trace"].
end
open →

files.sb / loop.sb

files + through loops.

read_file with "./data.txt".
loop line through lines ...
open →