Maze solving: Difference between revisions
m
→{{header|EasyLang}}
Line 1,440:
endpos = n * n - 2
startpos = n + 1
f = 100 / n▼
#
▲f = 100 / (n - 0.5)
x = pos mod n▼
set_color col▼
move_pen x * f y * f▼
draw_rect f * 1.05 f * 1.05▼
len m[] n * n
#
Line 1,463 ⟶ 1,449:
for i range len m[]
if m[i] = 0
▲ move_pen x * f - f / 2 y * f - f / 2
.
.
sleep 0.001
.
Line 1,476 ⟶ 1,465:
if dir = 0 and c <> n - 2 or dir = 1 and r <> n - 2 or dir = 2 and c <> 1 or dir = 3 and r <> 1
posn = pos + 2 * offs[dir]
.
.
Line 1,490 ⟶ 1,470:
m[pos] = 0
call show_maze
for i
dir =
call getposn pos dir posn
if posn <> -1 and m[posn] <> 0
Line 1,507 ⟶ 1,488:
call m_maze startpos
m[endpos] = 0
▲ found = 1
▲ .
.
#
call make_maze
call show_maze</lang>
=={{header|EGL}}==
|