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.
2020-09-21 12:01:54 +02:00
|
|
|
#!/usr/bin/env luajit
|
|
|
|
|
2020-09-28 12:53:04 +02:00
|
|
|
math.randomseed(os.time()) --set randomseed
|
2020-09-21 12:01:54 +02:00
|
|
|
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
|
2021-01-07 14:15:00 +01:00
|
|
|
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")
|
2020-09-21 12:01:54 +02:00
|
|
|
end
|
|
|
|
if i ~= layers then
|
|
|
|
io.write("n\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-12-30 16:08:43 +01:00
|
|
|
create_random_level(64, 64, 1)
|