API Reference › Builtin functions › print
function

print

print(x)

Writes its argument to standard output followed by a newline. It accepts either an integer or a string, so it is the go-to tool for quick debugging and for headless test programs that emit numbers a test harness can check. It is a diagnostic channel, separate from anything drawn on screen with the Screen API, and is most useful in Start- or Update-phase handlers while you are iterating. For interpolated messages, build the string first with a backtick template and pass that.

Parameters

xthe value to print, an int or a string

Example

program PrintScore {
  var score: int = 0

  handler CountUp phase Update {
    score = score + 10
    print(score)
    if score >= 30 { quit() }
  }
}
← All symbols