OxL Справочник OxL
РусскийEnglish

data sim

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

Example:

oxl✓ проверяется в 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

С версии. 1.0.0-beta

Методы

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

Определено в: std/test/test.oxl:357

См. также