Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- generate maze
- maze[route] = 5
- local tran = 0
- local j = 0
- local m = 0
- local b = 0
- gen1 = function(j,m,b)
- j = math.random(4)
- m = j
- gen2(j,m,b)
- end
- gen2 = function(j,m,b)
- b = route + a[j]
- if maze[b] == 8 then
- maze[b] = j
- tran = route + (a[j]/2)
- maze[tran] = 7
- route = b
- gen1(j,m,b)
- end
- j = j + 1
- if j == 5 then
- j = 1
- end
- if j ~= m then
- gen2(j,m,b)
- end
- j = maze[route]
- maze[route] = 7
- if j < 5 then
- route = route - a[j]
- gen1(j,m,b)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement