Maze generation: Difference between revisions

m
Delphi small fixes of my code
m (Delphi small fix)
m (Delphi small fixes of my code)
Line 2,062:
var
Maze : array[0..mwidth - 1, 0..mheight - 1] of TMCell;
Route : TStack<TPoint>;
 
procedure PrepareMaze;
Line 2,069 ⟶ 2,068:
d : Integer;
Pool : array of TPoint; // Pool of directions to pick randomly from
Route : TStack<TPoint>;
begin
Position := Point(Random(mwidth), Random(mheight));
Line 2,093:
Offset(Pool[d]);
 
if Maze[x, y].Visited then Continue;
Maze[x, y].Visited := True;
 
if Pool[d].y = -1 then Maze[x, y+1].PassTop := True; // comes from down to up ( ^ )
if Pool[d].x = 1 then Maze[x, y].PassLeft := True; // comes from left to right ( --> )
Anonymous user