mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Deleted rubyscreen.dll, eradicated semicolons from when... statements, compiling is now before setting up the system, appeased vocal dissenters
This commit is contained in:
@@ -335,22 +335,31 @@ class Maze
|
||||
end
|
||||
end
|
||||
|
||||
def recurseDepthFirst(x,y,depth)
|
||||
def recurseDepthFirst(x, y, depth)
|
||||
setVisited(x,y)
|
||||
dirs=@@dirs.shuffle!
|
||||
dirs = @@dirs.shuffle!
|
||||
for c in 0...4
|
||||
d=dirs[c]
|
||||
cx=0;cy=0
|
||||
d = dirs[c]
|
||||
cx = 0
|
||||
cy = 0
|
||||
case d
|
||||
when EdgeMasks::North; cx=x; cy=y-1
|
||||
when EdgeMasks::South; cx=x; cy=y+1
|
||||
when EdgeMasks::East; cx=x+1; cy=y
|
||||
when EdgeMasks::West; cx=x-1; cy=y
|
||||
when EdgeMasks::North
|
||||
cx = x
|
||||
cy = y - 1
|
||||
when EdgeMasks::South
|
||||
cx = x
|
||||
cy = y + 1
|
||||
when EdgeMasks::East
|
||||
cx = x + 1
|
||||
cy = y
|
||||
when EdgeMasks::West
|
||||
cx = x - 1
|
||||
cy = y
|
||||
end
|
||||
if cx>=0 && cy>=0 && cx<cellWidth && cy<cellHeight
|
||||
if !getVisited(cx,cy)
|
||||
clearEdgeNode(x,y,d)
|
||||
recurseDepthFirst(cx,cy,depth+1)
|
||||
if cx >= 0 && cy >= 0 && cx < cellWidth && cy < cellHeight
|
||||
if !getVisited(cx, cy)
|
||||
clearEdgeNode(x, y, d)
|
||||
recurseDepthFirst(cx, cy, depth + 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user