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

@ -8,11 +8,12 @@ subr initvars
indx = -1
no_time = 0
.
proc getind r c . ind .
func getind r c .
ind = -1
if r >= 0 and r <= 6 and c >= 0 and c <= 7
ind = r * 8 + c + 1
.
return ind
.
proc draw_cell ind h . .
ind -= 1
@ -54,7 +55,7 @@ proc open ind . .
cell[ind] = 2
flag[ind] = 0
color 686
call draw_cell ind cnt[ind]
draw_cell ind cnt[ind]
if cnt[ind] = 0
ind -= 1
r0 = ind div 8
@ -62,8 +63,7 @@ proc open ind . .
for r = r0 - 1 to r0 + 1
for c = c0 - 1 to c0 + 1
if r <> r0 or c <> c0
call getind r c ind
call open ind
open getind r c
.
.
.
@ -77,7 +77,7 @@ proc show_mines m . .
if m = -1
color 353
.
call draw_cell ind m
draw_cell ind m
.
.
.
@ -97,24 +97,24 @@ proc upd_info . .
.
.
if nc = 8
call outp 484 "Well done"
call show_mines -1
outp 484 "Well done"
show_mines -1
state = 1
else
call outp 464 8 - nm & " mines left"
outp 464 8 - nm & " mines left"
.
.
proc test ind . .
if cell[ind] < 2 and flag[ind] = 0
if cell[ind] = 1
call show_mines -1
show_mines -1
color 686
call draw_cell ind -2
call outp 844 "B O O M !"
draw_cell ind -2
outp 844 "B O O M !"
state = 1
else
call open ind
call upd_info
open ind
upd_info
.
.
.
@ -126,7 +126,7 @@ proc start . .
cnt[ind] = 0
cell[ind] = 0
flag[ind] = 0
call draw_cell ind 0
draw_cell ind 0
.
n = 8
while n > 0
@ -138,7 +138,7 @@ proc start . .
cell[ind] = 1
for rx = r - 1 to r + 1
for cx = c - 1 to c + 1
call getind rx cx ind
ind = getind rx cx
if ind > -1
cnt[ind] += 1
.
@ -146,8 +146,8 @@ proc start . .
.
.
.
call initvars
call outp 464 ""
initvars
outp 464 ""
textsize 4
move 5 93
text "Minesweeper - 8 mines"
@ -164,15 +164,15 @@ on mouse_down
color 464
rect 33 11
.
call getind (mouse_y - 2) div 12 (mouse_x - 2) div 12 indx
indx = getind ((mouse_y - 2) div 12) ((mouse_x - 2) div 12)
ticks0 = ticks
elif state = 3
call start
start
.
.
on mouse_up
if state = 0 and indx <> -1
call test indx
test indx
.
indx = -1
.
@ -183,8 +183,8 @@ on timer
elif state = 2
state = 3
elif no_time = 0 and ticks > 3000
call outp 844 "B O O M !"
call show_mines -2
outp 844 "B O O M !"
show_mines -2
state = 2
timer 1
else
@ -196,8 +196,8 @@ on timer
if flag[indx] = 1
opt = -3
.
call draw_cell indx opt
call upd_info
draw_cell indx opt
upd_info
.
indx = -1
.
@ -216,4 +216,4 @@ on timer
timer 0.1
.
.
call start
start