1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

Add anonymous functions

This commit is contained in:
Étienne Fildadut 2022-09-28 14:54:31 +09:00
parent 2c6d66c222
commit 5e441886c0
15 changed files with 352 additions and 110 deletions

View file

@ -125,7 +125,12 @@ if args.script or args.game then
print("error", err)
end
if args.save then
print(inspect(vm:save()))
local s, e = vm:save()
if s then
print(inspect(s))
else
print(("Error while saving: %s"):format(e))
end
end
-- test mode
@ -147,7 +152,7 @@ else
-- simple random to get the same result across lua versions
local prev = 0
local function badrandom(a, b)
prev = (42424242424242 * prev + 242) % 2^32
prev = (15485863 * prev + 11) % 2038074743
return a + prev % (b-a+1)
end
function math.random(a, b)