Minesweeper game: Difference between revisions
m
→{{header|EasyLang}}
Line 2,882:
=={{header|EasyLang}}==
[https://easylang.
<syntaxhighlight lang="text">
len cell[] 56
Line 2,894:
no_time = 0
.
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 . .
Line 2,940 ⟶ 2,941:
flag[ind] = 0
color 686
if cnt[ind] = 0
ind -= 1
Line 2,948 ⟶ 2,949:
for c = c0 - 1 to c0 + 1
if r <> r0 or c <> c0
.
.
Line 2,963:
color 353
.
.
.
Line 2,983:
.
if nc = 8
state = 1
else
.
.
Line 2,993:
if cell[ind] < 2 and flag[ind] = 0
if cell[ind] = 1
color 686
state = 1
else
.
.
Line 3,012:
cell[ind] = 0
flag[ind] = 0
.
n = 8
Line 3,024:
for rx = r - 1 to r + 1
for cx = c - 1 to c + 1
if ind > -1
cnt[ind] += 1
Line 3,032:
.
.
textsize 4
move 5 93
Line 3,050:
rect 33 11
.
ticks0 = ticks
elif state = 3
.
.
on mouse_up
if state = 0 and indx <> -1
.
indx = -1
Line 3,069:
state = 3
elif no_time = 0 and ticks > 3000
state = 2
timer 1
Line 3,082:
opt = -3
.
.
indx = -1
Line 3,102:
.
.
</syntaxhighlight>
|