#!/usr/bin/env luajit 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 io.write(math.floor(math.random() * 2)) --random 0 or 1 io.write("\n") end if i ~= layers then io.write("n\n") end end end create_random_level(50, 20, 1)