This repository has been archived on 2022-01-13. You can view files and clone it, but cannot push or open issues or pull requests.
jtmm2-old/levels/create_demo.lua

20 lines
521 B
Lua
Executable File

#!/usr/bin/env luajit
math.randomseed(os.time()) --set randomseed
local function create_random_level(width, height, layers)
io.write(width, "\n")
io.write(height, "\n")
for i = 1, layers, 1 do
for r = 1, width * height, 1 do
local var = math.ceil(math.random() * 4) * math.floor(math.random() * 1.5)
if var ~= 0 then var = var + math.floor(math.random() * 4) * 16 end
io.write(var, "\n")
end
if i ~= layers then
io.write("n\n")
end
end
end
create_random_level(64, 64, 1)