
Code: Select all
global player1,player2,whoIs,check
on openCard
repeat with i=1 to 5
repeat with j=1 to 5
put the text of field("p"&i&j) into check[i][j]
end repeat
end repeat
checkIfwin
--send openCard to me in 1 secs
end openCard
command checkIfwin
put 1 into verticalK
repeat with i=1 to 5
repeat with j=1 to 5
if j<5 then
if check[i][j]=check[i][j+1] then
put verticalK+1 into verticalK
if verticalK is 5 then
answer verticalK
pass checkIfwin
end if
end if
else
if verticalK is 5 then
answer verticalK
pass checkIfwin
else
put 1 into verticalK
end if
end if
end repeat
end repeat
end checkIfwin


