Examples

Ritual scripts

Small HexLang programs covering the core language.

Hello

whisper("The circle opens.");

Variables

summon candles = 13;
summon shadows = candles + 7;
whisper(shadows);

Functions

ritual bind(a, b) {
  offer a + b;
}

summon result = bind(3, 4);
whisper(result);

Conditionals

summon omenStrength = 8;

omen omenStrength > 5 {
  whisper("strong omen");
} otherwise {
  whisper("weak omen");
}

Loop

summon i = 0;
repeat i < 5 {
  whisper(i);
  i = i + 1;
}

Error example

// phantom is not declared
whisper(phantom);