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:
parent
2c6d66c222
commit
5e441886c0
15 changed files with 352 additions and 110 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue