|
@@ -271,7 +271,6 @@ procedure branch(x, y : word); { make a new branch of the tree }
|
|
var
|
|
var
|
|
runnum : word;
|
|
runnum : word;
|
|
d : byte;
|
|
d : byte;
|
|
- i : boolean;
|
|
|
|
begin
|
|
begin
|
|
runnum := maxrun; { max number of tree cells to add to a branch }
|
|
runnum := maxrun; { max number of tree cells to add to a branch }
|
|
connect(x, y); { first connect frontier cell to the tree }
|
|
connect(x, y); { first connect frontier cell to the tree }
|
|
@@ -283,7 +282,7 @@ begin
|
|
d := randomdir;
|
|
d := randomdir;
|
|
until d and runset > 0; { pick random direction to known frontier }
|
|
until d and runset > 0; { pick random direction to known frontier }
|
|
rembar(x, y, d); { and make it part of the tree }
|
|
rembar(x, y, d); { and make it part of the tree }
|
|
- i := adjust(x, y, d);
|
|
|
|
|
|
+ adjust(x, y, d);
|
|
addfront(x, y); { then pick up the neighboring frontier cells }
|
|
addfront(x, y); { then pick up the neighboring frontier cells }
|
|
dec(runnum);
|
|
dec(runnum);
|
|
end;
|
|
end;
|
|
@@ -329,7 +328,6 @@ procedure solve(x, y, endx, endy : word);
|
|
var
|
|
var
|
|
j, k : word;
|
|
j, k : word;
|
|
d : byte;
|
|
d : byte;
|
|
- i : boolean;
|
|
|
|
begin
|
|
begin
|
|
d := rightdir; { starting from left side of maze going right }
|
|
d := rightdir; { starting from left side of maze going right }
|
|
while (x <> endx) or (y <> endy) do
|
|
while (x <> endx) or (y <> endy) do
|
|
@@ -346,7 +344,7 @@ begin
|
|
end;
|
|
end;
|
|
j := x;
|
|
j := x;
|
|
k := y;
|
|
k := y;
|
|
- i := adjust(x, y, d); { go in that direction }
|
|
|
|
|
|
+ adjust(x, y, d); { go in that direction }
|
|
with cell^[j,k] do
|
|
with cell^[j,k] do
|
|
begin { turn on dot, off if we were here before }
|
|
begin { turn on dot, off if we were here before }
|
|
flags := ((((cell^[x,y].flags xor $80) xor flags) and $80) xor flags);
|
|
flags := ((((cell^[x,y].flags xor $80) xor flags) and $80) xor flags);
|
|
@@ -408,7 +406,6 @@ var
|
|
x, y,
|
|
x, y,
|
|
endx,
|
|
endx,
|
|
endy : word;
|
|
endy : word;
|
|
- ch : char;
|
|
|
|
begin
|
|
begin
|
|
x := 1; { pick random start on left side wall }
|
|
x := 1; { pick random start on left side wall }
|
|
y := random(height) + 1;
|
|
y := random(height) + 1;
|
|
@@ -419,8 +416,8 @@ begin
|
|
mansolve(x, y, endx, endy); { try it manually }
|
|
mansolve(x, y, endx, endy); { try it manually }
|
|
solve(x, y, endx, endy); { show how when he gives up }
|
|
solve(x, y, endx, endy); { show how when he gives up }
|
|
while keypressed do
|
|
while keypressed do
|
|
- ch := readkey;
|
|
|
|
- ch := readkey;
|
|
|
|
|
|
+ readkey;
|
|
|
|
+ readkey;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|