neyuki 0.1.0

A small Lua-like scripting language implemented in Rust
1
2
3
4
5
6
7
8
9
10
11
local math = require("@neyuki/math")

for i in {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} do
    local value = math.random(1, 10)
    assert(value >= 1 and value <= 10, "random value is outside the requested range")
end

local ok, err = try(math.random, 10, 1)
assert(not ok, "random should reject an inverted range")

print("[pass] randomization")