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 13:21:18 +01:00
|
|
|
io.write(math.ceil(math.random() * 4) * math.floor(math.random() * 1.5))
|
2020-09-21 12:01:54 +02:00
|
|
|
io.write("\n")
|
|
|
|
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)
|