OxL Reference

data sim

Namespace of the simulation itself: sim.seed(), sim.rand(1, 6).

Example:

oxl✓ checked in CI
use std.test { sim }

test sim "same seed same numbers" seeds 1..=3 {
  let a = sim.rand(1, 6)
  assert a >= 1 && a <= 6
}
pub(api) data sim

Since. 1.0.0-beta

Methods

seed() -> u64
The seed of this run (oxl test --seed N).
rand(lo: i64, hi: i64) -> i64
A deterministic random integer in lo..=hi; the sequence depends only on the seed.
note(text: str)
Adds a line to the trace of the run (and so to its hash).
traceHash() -> u64
Hash of everything that happened in the simulated world so far

Defined in: std/test/test.oxl:357

See also