Data update

This commit is contained in:
Ingy döt Net 2023-09-16 17:28:03 -07:00
parent 5af6d93694
commit 796d366b97
455 changed files with 7413 additions and 1900 deletions

View file

@ -20,7 +20,7 @@ proc show_maze . .
offs[] = [ 1 n -1 (-n) ]
proc m_maze pos . .
m[pos] = 0
call show_maze
show_maze
d[] = [ 1 2 3 4 ]
for i = 4 downto 1
d = random i
@ -28,7 +28,7 @@ proc m_maze pos . .
d[d] = d[i]
if m[pos + dir] = 1 and m[pos + 2 * dir] = 1
m[pos + dir] = 0
call m_maze pos + 2 * dir
m_maze pos + 2 * dir
.
.
.
@ -44,11 +44,11 @@ proc make_maze . .
m[n * n - n + i] = 2
.
h = 2 * random 15 - n + n * 2 * random 15
call m_maze h
m_maze h
m[endpos] = 0
.
call make_maze
call show_maze
make_maze
show_maze
#
proc mark pos col . .
x = (pos - 1) mod n
@ -57,25 +57,29 @@ proc mark pos col . .
move x * f + f / 4 y * f + f / 4
circle f / 3.5
.
proc solve dir0 pos . found .
call mark pos 900
global found .
proc solve dir0 pos . .
if found = 1
return
.
mark pos 900
sleep 0.05
if pos = endpos
found = 1
break 1
return
.
of = random 4 - 1
for h = 1 to 4
dir = (h + of) mod1 4
posn = pos + offs[dir]
if dir <> dir0 and m[posn] = 0 and found = 0
call solve (dir + 1) mod 4 + 1 posn found
if dir <> dir0 and m[posn] = 0
solve (dir + 1) mod 4 + 1 posn
if found = 0
call mark posn 888
mark posn 888
sleep 0.08
.
.
.
.
sleep 1
call solve 0 n + 2 found
solve 0 n + 2