There is a condition in the game X_0:
if (a[1]=gmr1) and (a[2]=gmr1) and (a[3]=gmr1) then pobed:=1; if (a[4]=gmr1) and (a[5]=gmr1) and (a[6]=gmr1) then pobed:=1; if (a[7]=gmr1) and (a[8]=gmr1) and (a[9]=gmr1) then pobed:=1; if (a[1]=gmr1) and (a[5]=gmr1) and (a[9]=gmr1) then pobed:=1; if (a[3]=gmr1) and (a[5]=gmr1) and (a[7]=gmr1) then pobed:=1;
Comparison of cells. gmr1 = gamer1
. How to make a tie condition? a [] - array stores cells. gmr1 - player 1. Draw condition - no 3x matching combinations (i.e., three identical cells - vertical, diagonal, horizontal) With this arrangement, it immediately goes: Draw.
if (pobed=0) and (a[1]<>gmr1) and (a[2]<>gmr1) and (a[3]<>gmr1) and (a[4]<>gmr1) and (a[5]<>gmr1) and (a[8]<>gmr1) and (a[7]<>gmr1) and (a[8]<>gmr1) and (a[9]<>gmr1) and (a[1]<>gmr1) and (a[5]<>gmr1) and (a[9]<>gmr1) and (a[3]<>gmr1) and (a[5]<>gmr1) and (a[7]<>gmr1) then pobed:=3; // ничья
gmr1
? What does ana[]
array store? And, actually, what should be the condition of a draw? - KiTE