var win := Window.Open ("position:0;0,graphics:560;560")
for x : 1 .. 480 by 80
drawline (80 + x, 0, 80 + x, 560, 7)
end for
for x : 1 .. 480 by 80
drawline (0, 80 + x, 560, 80 + x, 7)
end for
loop
var x, y, button, c : int := 0
var v : boolean := false
loop
mousewhere (x, y, button)
for h : 1 .. 560 by 80
for i : 1 .. 560 by 80
if x > 0 + h and x < 80 + h and y > 0 + i and y < 80 + i and button = 1 and whatdotcolor (40 + h, 40 + i) not= 14 and whatdotcolor (40 + h, 40 + i) not= 1 then
drawfilloval (40 + h, 40 + i, 35, 35, 44)
v := true
end if
end for
end for
exit when button = 1 and x < 560 and x > 0 and y > 0 and y < 560 and v = true
end loop
v := false
loop
c := Rand.Int (1, 48)
var m := 0
for h : 0 .. 560 by 80
for i : 1 .. 560 by 80
m := m + 1
if c = 1 + m and whatdotcolor (40 + h, 40 + i) not= 14 and whatdotcolor (40 + h, 40 + i) not= 1 then
drawfilloval (40 + h, 40 + i, 35, 35, 1)
v := true
end if
exit when v = true
end for
exit when v = true
end for
exit when v = true
end loop
for h : 1 .. 560
for i : 1 .. 560
if whatdotcolour (h, i) = 14 then
if whatdotcolour (h, i) = 14 and whatdotcolour (h + 80, i) = 14 and whatdotcolour (h + 160, i) = 14 and whatdotcolour (h + 240, i) = 14 and whatdotcolour (h + 320, i) = 14 then
locate (1, 1)
put "u win"
elsif whatdotcolour (h, i) = 14 and whatdotcolour (h, i + 80) = 14 and whatdotcolour (h, i + 160) = 14 and whatdotcolour (h, i + 240) = 14 and whatdotcolour (h, i + 320) = 14 then
locate (1, 1)
put "u win"
elsif whatdotcolour (h, i) = 14 and whatdotcolour (h + 80, i + 80) = 14 and whatdotcolour (h + 160, i + 160) = 14 and whatdotcolour (h + 240, i + 240) = 14 and whatdotcolour (h + 320,
i + 320) = 14 then
locate (1, 1)
put "u win"
elsif whatdotcolour (h, i) = 14 and whatdotcolour (h - 80, i + 80) = 14 and whatdotcolour (h - 160, i + 160) = 14 and whatdotcolour (h - 240, i + 240) = 14 and whatdotcolour (h - 320,
i + 320) = 14 then
locate (1, 1)
put "u win"
end if
end if
end for
end for
for h : 1 .. 560
for i : 1 .. 560
if whatdotcolour (h, i) = 1 then
if whatdotcolour (h, i) = 1 and whatdotcolour (h + 80, i) = 1 and whatdotcolour (h + 160, i) = 1 and whatdotcolour (h + 240, i) = 1 and whatdotcolour (h + 320, i) = 1 then
locate (1, 1)
put "u lose"
elsif whatdotcolour (h, i) = 1 and whatdotcolour (h, i + 80) = 1 and whatdotcolour (h, i + 160) = 1 and whatdotcolour (h, i + 240) = 1 and whatdotcolour (h, i + 320) = 1 then
locate (1, 1)
put "u lose"
elsif whatdotcolour (h, i) = 1 and whatdotcolour (h + 80, i + 80) = 1 and whatdotcolour (h + 160, i + 160) = 1 and whatdotcolour (h + 240, i + 240) = 1 and whatdotcolour (h + 320,
i + 320) = 1 then
locate (1, 1)
put "u lose"
elsif whatdotcolour (h, i) = 1 and whatdotcolour (h - 80, i + 80) = 1 and whatdotcolour (h - 160, i + 160) = 1 and whatdotcolour (h - 240, i + 240) = 1 and whatdotcolour (h - 320,
i + 320) = 1 then
locate (1, 1)
put "u lose"
end if
end if
end for
end for
end loop
|