Recently, the course design has been made, but the two functions of the five son chess, but "regret" and "save chess bodies" will not be realized, please enlighten the home:
Option ExplicitDim comable As BooleanDim comturn As BooleanDim blackturn As BooleanDim whiteturn As BooleanDim comcolor As LongDim black As LongDim white As LongDim i As SingleDim j As SingleDim table (-5 To 20, -5 To 20) As Integer 'indicated by the two-dimensional array checkerboard'
Private sub restart () form_painTfor i = 0 to 15 for j = 0 to 15 table (i, j) = 0 Next JNEXT IBLACK = RGB (0, 0, 0) White = RGB (255, 255, 255) if Comtrurn = True Then Call Goes (7, 7) End Sub
Private Sub Goes (I as single, j as single) 'computer walks to Table (i, j)' if Comtrurn = true and table (i, j) = 0 ThenfillColor = ComcolorfillStyle = 0dim x as singledingim y as singlex = i * 300 100Y = j * 300 100circle (x, y), 100comturn = falsetable (i, j) = 21END IFEND SUB
Private substract_click () frMabout.shownd Sub
Private sub doubleman_click () 'Double' BlackTurn = TrueWhitturn = falseComable = falseComturn = falserestndend Sub
Private sub withdraw _Click () DIM I as integer i = msgbox ("Do you want to exit the game?", VBOKCANCEL VBEXCLAMATION, "Tip") IF i = VBOK THEN UNLOAD ME END IFEND SUB
Private Sub Form_Load () form_paintcomturn = trueend Sub
Private Sub Form_Mousedown (Button As INTEGER, SHIFT AS INTEGER, X As Single, Y askle) 'people walk' Dim A as Singledim B AS Singledim M AS Singledim N as Singleif (x - 100) MOD 300 <150 THEN A = X - (x - 100) MOD 300 elseif (x - 100) MOD 300> 150 TEN A = x 300 - (x - 100) mod 300nd IFIF (Y - 100) MOD 300 <150 THEN B = Y - (Y - 100) MOD 300 Elseif (Y - 100) MOD 300> 150 THEN B = Y 300 - (Y - 100) MOD 300ED IFI = (A - 100) / 300J = (B - 100) / 300IF (COMTURN = FALSE) And (Table (i, j) = 0) Thenif BlackTurn = True Then FillColor = Black ElsefillColor = WhiteEnd iffillstyle = 0CIRCLE (A, B), 100TABLE (i, j) = 1
IF comable = false kiln = blackturn xor true
If Comate = true kiln = truejudgemancomdojudgecomend IF 'human machine battle
End ifnd subsprivate sub judgeman () 'Did the person wins? DIM I as Single Dim J AS Single for i = 0 to 15 for j = 0 to 15 if Table (i, j) * Table (i, j 1) * Table (i, j 2) * Table (i, j 3) * Table (i, j 4) = 1 Then msgbox "you won, awesome!" Elseif Table (i, j) * Table (i 1, J) * Table (i 2, j) * Table (i 3, j) * Table (i 4, j) = 1 Ten msgbox "You won, awesome!" Elseif Table (i, J) * TABLE (i 1, j 1) * Table (i 2, j 2) * Table (i 3, j 3) * Table (i 4, j 4) = 1 THEN MSGBOX "You won, great!" Elseif Table (i, j) * Table (i - 1, j 1) * Table (i - 2, j 2) * Table (i - 3, j 3) * Table (i - 4, j 4) = 1 damGBox "you won, awesome!" End if Next J Next Iend Subprivate Sub Judgecom () Judging whether the computer wins' DIM I as Singledim J AS SingleFor i = 0 To 15for J = 0 TO 15IF Table (i, j) * Table (i, j 1) * Table (i, j 2) * Table (i, j 3) * Table (i, j 4) = 32 THEN MSGBOX "You lose, continue to work hard!" Elseif Table (I, J) * Table (i 1, j) * Table (i 2, j) * Table (i 3, J) * Table (i 4, j) = 32 THEN MSGBOX "You lose, continue to work! Elseif Table (i, j) * Table (i 1, j 1) * Table (i 2, j 2) * Table (i 3, j 3) * Table (i 4, j 4) = 32 THEN MSGBOX "You lose, continue to work hard! "Elseif Table (i, j) * Table (i - 1, j 1) * Table (i - 2, j 2) * Table (i - 3, j 3) * Table (i - 4, j 4) = 32 THEN MSGBOX "You lost,
Continue to work hard! "End ifnext JNext Iend Sub
Private Function Wantfive (i, j, k) as boolean 'settled 1'if table (i, j) = 0 and (Table (i - 4, j) * Table (i - 3, j) * Table (i - 2 , J) * Table (i - 1, j) = k * k * k * k _ or table (i - 4, j - 4) * Table (i - 3, j - 3) * Table (i - 2, J - 2 * Table (i - 1, j - 1) = k * k * k * k _ or table (i, j - 4) * Table (i, j - 3) * Table (i, j - 2 * Table (i, j - 1) = k * k * k * k _ or table (i 1, j - 1) * Table (i 2, j - 2) * Table (i 3, j - 3) * Table (i 4, j - 4) = k * k * k * k _ or table (i 1, j) * Table (i 2, j) * Table (i 3, j) * Table (i 4, j) = k * k * k * k _ or table (i 1, j 1) * Table (i 2, j 2) * Table (i 3, j 3) * Table (i 4, j 4) = k * k * k * k _ or table (i, j 1) * Table (i, j 2) * Table (i, j 3) * table (i, j 3) * TABLE I, J 4) = K * K * K * K _ or Table (i - 1, j 1) * Table (i - 2, j 2) * Table (i - 3, j 3) * Table (i - 4 , J 4) = k * k * k * k _ or Table (i - 3, i) * Table (i - 2, j) * Table (i - 1, j) * Table (i 1, j) = K * K * K * K _ or Table (i - 3, j - 3) * Table (i - 2, j - 2) * Table (i - 1, j - 1) * Table (i 1, j 1) = k * k * k * k _ or table (i, j - 3) * Table (i, j - 2) * Table (i, j - 1) * Table (i, j 1) =
K * K * K * K _ or Table (i 1, j - 1) * Table (i 2, j - 2) * Table (i 3, j - 3) * Table (i - 1, j 1) = k * k * k * k _ or table (i 1, j) * table (i 2, j) * Table (i 3, j) * Table (i - 1, j) = k * K * K * K _ or Table (i 1, j 1) * Table (i 2, j 2) * Table (i 3, j 3) * Table (i - 1, j - 1) = k * k * k * k _ or table (i, j 1) * Table (i, j 2) * Table (i, j 3) * table (i, j - 1) = k * k * K * K _ or Table (i - 1, j 1) * Table (i - 2, j 2) * Table (i - 3, j 3) * Table (i 1, j - 1) = k * K * K * K _ OR Table (i - 2, j) * Table (i - 1, j) * Table (i 1, j) * Table (i 2, j) = k * k * k * K_ or Table (I - 1, J - 1) * Table (i - 2, j - 2) * Table (i 1, j 1) * Table (i - 2, j - 2) = k * k * k * k _ or table (i, j - 2) * Table (i, j - 1) * Table (i, j 1) * table (i, j 2) = k * k * K * K _ or Table (i 1, j - 1) * Table (i 2, j - 2) * Table (i - 1, j 1) * Table (i - 2, j 2) = k * K * K * K _) Then Wantfive = True End FunctionPrivate Function Wantfour (i, j, k) as boolean 'fixed 2'if table (i, j) = 0 and ((Table (i - 3, j) = 0 and Table (i 2, j) =
0 and Table (i - 2, j) * table (i - 1, j) * Table (i 1, j) = k * k * k) _ or (Table (i - 3, j - 3) = 0 And Table (i 2, j 2) = 0 and Table (i - 2, j - 2) * Table (i - 1, j - 1) * Table (i 1, j 1) = k * k * K) _ or (Table (i, j - 3) = 0 and Table (i, j 2) = 0 AND TABLE (i, j - 2) * Table (i, j - 1) * Table (i, J 1) = k * k) _ or (Table (i 3, j - 3) = 0 and Table (i - 2, j 2) = 0 and Table (i 2, j - 2) * TABLE (i 1, j - 1) * Table (i - 1, j 1) = k * k * k) _ or (Table (i 3, j) = 0 and Table (i - 2, j = 0 and Table (i 2, j) * Table (i 1, j) * table (i - 1, j) = k * k * k) _ or (Table (i 3, j 3) = 0 AND TABLE (i - 2, j - 2) = 0 and Table (i 2, j 2) * Table (i 1, j 1) * Table (i - 1, j - 1) = k * K * K) _ or (Table (i, j 3) = 0 an D Table (i, j - 2) = 0 AND TABLE (i, j 1) * Table (i, j 2) * Table (i, j - 1) = k * k * k) _ or (Table I - 3, J 3) = 0 AND TABLE (i 2, j - 2) = 0 and Table (i - 2, j 2) * Table (i - 1, j 1) * Table (i 1, J - 1) = k * k * k) _) THEN WANTFOUR = True End Function Private Function Wantfour1 (i, J, K) AS Boolean '
Table 3 'DIM A (0 to 7) AS Single Dim N as Single A (0) = Table (i - 3, j) * Table (i - 2, j) * Table (i - 1, j) a (1 ) = TABLE (i - 3, j - 3) * Table (i - 2, j - 2) * Table (i - 1, j - 1) a (2) = Table (i, j - 3) * TABLE ( I, J - 2) * Table (i, j - 1) a (3) = Table (i 3, j - 3) * Table (i 2, j - 2) * Table (i 1, j - 1) A (4) = Table (i 3, j) * Table (i 2, j) * Table (i 1, j) a (5) = Table (i 1, j 1) * TABLE (i 2, j 2) * Table (i 3, j 3) a (6) = Table (i, j 1) * Table (i, j 2) * Table (i, j 3 ) A (7) = TABLE (i - 1, j 1) * Table (i - 2, j 2) * Table (i - 3, j 3) DIM B (0 to 7) as single b (0 ) = TABLE (i 1, j) b (1) = Table (i 1, j 1) b (2) = Table (i, j 1) b (3) = Table (i - 1, j 1) b (4) = Table (i - 1, j) b (5) = Table (i - 1, j - 1) b (6) = Table (i, j - 1) b (7) = TABLE (i 1, j - 1) for n = 0 to 7 if Table (i, j) = 0 and b (n) = 0 and a (n) = k * k * k Then Wantfour1 = true end if next n END FUNCTIONPRIVATE FUNCTION WANT231 (i, J, K) AS Boolean 'fixed 4 'Dim A (0 to 7) as single a (0) = Table (i - 2, j) * Table (i - 1, j) a (1) = Table (i - 2, j - 2) * Table I - 1, J - 1) A (2) = Table (I, J - 2) * Table (I, J - 1) A (3) = TABLE (i 2, J - 2) * Table (i 1, J - 1) a (4) = Table (i 1, j) * Table (i 2, j) a (5) = Table (i 1, j 1) * Table (i 2, J 2) a (6) = Table (i, j 1) * Table (i, j 2) a (7) = Table (i - 1, j 1) * Table (i - 2, j 2)
IF table (i, j) = 0 and ((Table (i - 3, j) <> 3 - k And Table (i - 3, j - 3) <> 3 - k And a (0) * a (1 ) = k * k * k * k) _ or (Table (i - 3, j) <> 3 - k And Table (i, j - 3) <> 3 - k And a (0) * a (2) = k * k * k * k) _ or (Table (i - 3, j) <> 3 - k And Table (i 3, j - 3) <> 3 - k And a (0) * a (3 ) = k * k * k * k) _ or (Table (i - 3, j) <> 3 - k And Table (i 3, j 3) <> 3 - k And a (0) * a ( 5) = k * k * k * k) _ or (Table (i - 3, j) <> 3 - k And Table (i, j 3) <> 3 - k And a (0) * a (6 ) = k * k * k * k) _ or (Table (i - 3, j) <> 3 - k And Table (i - 3, j 3) <> 3 - k And A (0) * a ( 7) = k * k * k * k) _ or (Table (i - 3, j - 3) <> 3 - k And Table (i, j - 3) <> 3 - k And a (1) * a (2) = k * k * k * k) _ or (Table (i - 3, j - 3) <> 3 - k And Table (i 3, j - 3) <> 3 - k And a (1) * a (3) = k * k * k * k) _ or (Table (i - 3 , J - 3) <> 3 - k And Table (i 3, j) <> 3 - k And A (1) * a (4) = k * k * k * k) _ or (Table (i - 3, J - 3) <> 3 - k And Table (I, J 3) <> 3 - k And A (1) * a (6) = k * k * k * k) _ or (Table (i) - 3, J - 3) <> 3 - k And Table (i - 3, j 3) <> 3 - k And A (1) * a (7) =
K * k * k * k) _ or (Table (i, j - 3) <> 3 - k And Table (i 3, j - 3) <> 3 - k And a (2) * a (3) = k * k * k * k) _ or (Table (i, j - 3) <> 3 - k And Table (i 3, j) <> 3 - k And a (2) * a (4) = K * K * K * K) _ OR (Table (I, J - 3) <> 3 - k And Table (i 3, J 3) <> 3 - k And A (2) * a (5) = k * k * k * k) _ or (Table (i, j - 3) <> 3 - k And Table (i - 3, j 3) <> 3 - k And a (2) * a (7 ) = k * k * k * k) _ or (Table (i 3, j - 3) <> 3 - k And Table (i 3, j) <> 3 - k And a (3) * a ( 4) = k * k * k * k) _ or (Table (i 3, j - 3) <> 3 - k And Table (i 3, j 3) <> 3 - k And a (3) * a (5) = k * k * k * k) _ or (Table (i 3, j - 3) <> 3 - k And Table (i, j 3) <> 3 - k And a (3 ) * a (6) = k * k * k * k) _ OR (Table (i 3, j) <> 3 - k And Table (i 3, j 3) <> 3 - k And a (4) * a (5) = k * k * k *k) _ OR (Table (I 3, J) <> 3 - K and Table (i, J 3) <> 3 - k And A (4) * a (6) = k * k * k * k) _ OR (Table (i 3, j) <> 3 - k And Table (i - 3, j 3) <> 3 - k And a (4) * a (7) = k * k * k * k) _ OR (Table (i 3, J 3) <> 3 - K and Table (i, J 3) <>
3 - k And A (5) * a (6) = k * k * k * k) _ or (Table (Table (i 3, j 3) <> 3 - k And Table (i - 3, J 3 <> 3 - k And a (5) * a (7) = k * k * k * k) _ or (Table (i, j 3) <> 3 - k And Table (i - 3, j 3) <> 3 - k And A (6) * a (7) = k * k * k * k) _) THEN WANT231 = True End Function Private function WANT232 (i, J, K) AS Boolean 'fixed 5' DIM B (0 to 3) As Single B (0) = Table (i - 1, j) * Table (i 1, j) B (1) = Table (i - 1, j - 1) * TABLE (i 1, J 1) b (2) = Table (i, j - 1) * Table (i, j 1) b (3) = Table (i 1, j - 1) * Table (i - 1 , J 1) IF Table (i, j) = 0 and ((Table (i - 2, j) <> 3 - k And Table (i 2, j) <> 3 - k And Table (i - 2 , J - 2) <> 3 - k And Table (i 2, J 2) <> 3 - k And b (0) * b (1) = k * k) _ or (Table (i - 2, J) <> 3 - k And Table (i 2, j) <> 3 - k And Table (i, j - 2) <> 3 - k And Table (I, J 2) <> 3 - k And b (0) * b (2) = k * k) _ or (Table (i - 2, j) <> 3 - k And Table (i 2, j) <> 3 - k And Table (i 2, J - 2) <> 3 - k And Table (i - 2, j 2) <> 3 - k And b (0) * b (3) = k * k) _ or (Table (i - 2 , J - 2) <> 3 - k And Table (i 2, J 2) <> 3 - k And Table (i, J - 2) <> 3 - K and Table (i, j 2) < > 3 - k And B (1) * b (2) = k * k) _ or (Table (i - 2, j - 2) <>
3 - K and Table (i 2, j 2) <> 3 - k And Table (i 2, j - 2) <> 3 - k And Table (i - 2, j 2) <> 3 - K and B (1) * b (3) = k * k) _ or (Table (i, j - 2) <> 3 - k And Table (i, j 2) <> 3 - k And Table (i 2, J - 2) <> 3 - k And Table (i - 2, j 2) <> 3 - k And b (2) * b (3) = k * k) _) THEN WANT232 = true end FunctionFunction Want233 (I, J, K) AS Boolean 'Stenit 6' DIM M AS Single Dim N As Single Dim B (0 to 7) AS Single Dim B1 (0 to 7) AS Single Dim A (0 to 7) as Single DIM A1 (0 to 7) As Single B (0) = Table (i - 1, j) B (1) = Table (i - 1, j - 1) b (2) = Table (i, j - 1) B (3) = Table (i 1, j - 1) b (4) = Table (i 1, j) b (5) = Table (i 1, j 1) b (6) = TABLE I, J 1) b (7) = Table (i - 1, j 1) b1 (0) = Table (i - 2, j) b1 (1) = Table (i - 2, j - 2) b1 (2) = Table (I, J - 2) B1 (3) = Table (i 2, j - 2) b1 (4) = Table (i 2, j) b1 (5) = Table (i 2 , J 2) B1 (6) = Table (I, J 2) B1 (7) = Table (I - 2, J 2) a (0) = TABLE (i - 2, J) * Table (i - 1, j) a (1) = Table (i - 2, j - 2) * Table (i - 1, j - 1) a (2) = Table (i, j - 2) * Table (i, j - 1) a (3) = Table (i 1, j - 1) * Table (i 2, j - 2) a (4) = Table (i 1, j * Table (i 2, j) a (5) = Table (i 1, j 1) * Table (i 2, j 2) a (6) = Table (i, j 1) * Table (i, j 2) a (7) = Table (i - 1, j 1) * Table (i - 2, j 2) A1 (0) = TABLE (i - 3, j) A1 (1 ) = TABLE (I - 3, J - 3) A1 (2) = Table (i, J - 3) A1 (3) = TABLE (i
3, J - 3) A1 (4) = Table (I 3, J) A1 (5) = Table (i 3, J 3) A1 (6) = Table (I, J 3) A1 (7 ) = TABLE (i - 3, j 3) for m = 0 to 3 for n = 0 to 7 IF (B1 (m) <> 3 - k And B1 (M 4) <> 3 - k And A1 ( N) <> 3 - k And b (m) * b (m 4) = k * k) and n <> m and n <> m 4 and a (n) = k * k Then Want233 = true end If Next N Next M End FunctionPrivate Function Wantthree (I as Single, J AS Single, K as Single) AS Boolean 'Type 7'dim A (0 to 7) As Singledge (i - 2, J) * Table (i - 1, j) a (1) = Table (i - 2, j - 2) * Table (i - 1, j - 1) a (2) = Table (i, j - 2) * Table (i, j - 1) a (3) = Table (i 1, j - 1) * Table (i 2, j - 2) a (4) = Table (i 1, j) * TABLE (i 2, j) a (5) = Table (i 1, j 1) * Table (i 2, j 2) a (6) = Table (i, j 1) * Table (i , J 2) A (7) = Table (i - 1, j 1) * Table (i - 2, j 2) for n = 0 to 7 if Table (i, j) = 0 and A (N ) = k * k Then Wantthree = true end if Next Nend function
Private Sub Comdim B AS SingleFor A = -5 To 20FOR B = -5 TO 20IF (a <0) OR (A> 15) OR (B> 15) THENTABLE (A , B) i 'even five child for i = 0 to 15 for j = 0 to 15 if Comtrurn = True and Wantfive (i, j, 1) = True THEN CALL GoES (i, j) end if next j next i' blocks the other party For i = 0 to 15 for J = 0 to 15 if Comtrurn = True and Table (i, j) * Table (i, j 1) * Table (i, j 2) = 8 and (Table (i, j - 1) = 0 and Table (i, j 3) = 0) Then if Table (i, j - 2) = 2 or table (i - 1, j - 1) = 2 or Table (i - 1, j ) = 2 or table (i - 1, j 1) = 2 or table (i 1, j - 1) = 2 or table (i 1, j) = 2 or Table (i 1, j 1 = 2 THEN CALL GoES (i, j - 1) Else Call Goes (i, j 3) end if elseif chart = true and table (i, j) * tabl E (i 1, j) * Table (i 2, j) = 8 and (Table (i - 1, j) = 0 and Table (i 3, j)) = 0 THEN if Table (i - 2 , J) = 2 or Table (I - 1, J - 1) = 2 or Table (i, j - 1) = 2 or Table (i 1, j - 1) = 2 or Table (i - 1, j 1) = 2 or Table (i, j 1) = 2 or Table (i 1, j 1) = 2 THEN CALL GoES (i - 1, j) Else Call Goes (i 3, j) end IF Elseif Comtrurn = True and Table (i, j) * Table (i 1, J 1) * Table (i 2, J 2) = 8 and (Table (i - 1, j - 1) = 0 AND TABLE (i
3, J 3) = 0) THEN IF TABLE (i - 2, j - 2) = 2 or Table (i - 1, j) = 2 or Table (i - 1, j 1) = 2 or table I, J - 1) = 2 or Table (i, j 1) = 2 or Table (i 1, j - 1) = 2 or table (i 1, j) = 2 THEN CALL GoES (i - 1 , J - 1) Else Call Goes (I 3, J 3) end if elseif chart = true and table (i, j) * Table (i - 1, j 1) * Table (i - 2, j 2) = 8 and (Table (i 1, j - 1) = 0 and Table (i - 3, j 3) = 0) Then IF Table (i 2, j - 2) = 2 or Table (i - 1, J - 1) = 2 or Table (i, j - 1) = 2 or Table (i - 1, j) = 2 or Table (i 1, j) = 2 or Table (i 1, j 1) = 2 or Table (i, j 1) = 2 THEN CALL GoES (i 1, j - 1) Else Call Goes (i - 3, j 3) end if end if next j next i ' I am connected to four o'clock for i = 0 to 15 for j = 0 to 15 if Comtrurn = True and Wantfour (i, j, 2) = TRUE THEN CALL GoES (i, j) end if next j next i ' I am connected to four o'clock for i = 0 to 15 for j = 0 to 15 if Comtrurn = True and Wantfour1 (i, j, 2) = True THEN CAL l Goes (i, j) end if next j next I 'called for i = 0 to 15 for j = 0 to 15 if Comtrurn = True and Table (i, j) * Table (i, j 1) * TABLE (i, j 2) = 1 and (Table (i, j - 1) = 0 and Table (i, j 3) = 0) THEN IF TABLE (i, j - 2) = 1 or Table (i - 1, J - 1) = 1 or Table (i - 1, j) = 1 or Table (i - 1, j 1) = 1 or Table (i 1, j - 1) = 1 or Table (i 1, j) = 1 or Table (i 1, j 1) =
1 THEN CALL GoES (i, j - 1) Else Call Goes (i, j 3) end if elseif chart = true and table (i, j) * Table (i 1, j) * Table (i 2, J) = 1 and (Table (i - 1, j) = 0 and Table (i 3, j) = 0) THEN IF TABLE (i - 2, j) = 1 or Table (i - 1, j - 1 ) = 1 or table (i, j - 1) = 1 or table (i 1, j - 1) = 1 or Table (i - 1, j 1) = 1 or Table (i, j 1) = 1 or Table (i 1, j 1) = 1 THEN CALL GoES (i - 1, j) Else Call Goes (i 3, j) end if elseif chart = true and table (i, j) * table i 1, j 1) * Table (i 2, j 2) = 1 and (Table (i - 1, j - 1) = 0 and Table (i 3, j 3) = 0) THEN IF Table (i - 2, j - 2) = 1 or Table (i - 1, j) = 1 or Table (i - 1, j 1) = 1 or Table (i, j - 1) = 1 or TABLE (i, j 1) = 1 or Table (i 1, j - 1) = 1 or Table (i 1, j) = 1 THEN CALL GoES (i - 1, j - 1) else Call Goes (i 3, J 3) End if elseif Comtrurn = True and Table (i, j) * Table (i - 1, j 1) * Table (i - 2, j 2) = 1 and (Table (i 1, J - 1) = 0 and Table (i - 3, j 3) = 0) THEN IF TABLE (i 2, j - 2) = 1 or Table (i - 1, j - 1) = 1 or Table (i , J - 1) = 1 or Table (i - 1, j) = 1 or Table (i 1, j) = 1 or Table (i 1, j 1) = 1 or Table (i, j 1 = 1 THEN CALL GoES (i 1, j - 1) Else Call Goes (i - 3, j 3) end if end if next j next i 'blocks other four-point line for i = 0 to 15 for J = 0 to 15 if Comtrurn = True and Wantfour (i, j, 1) =
True Then Call Goes (i, j) end if next j next i 'blocks the other party four-point force for i = 0 to 15 for j = 0 to 15 if Comtrurn = true and (Want231 (i, j, 1) = true _ Or Want232 (I, J, 1) = True_ or Want233 (i, J, 1) = true) THEN CALL GoES (i, j) end if next j next i 'blocks the other party to walk Shuangyan for i = 0 to 15 for j = 0 to 15 if Comtrurn = True and (Want231 (i, J, 2) = true _ or want232 (i, j, 2) = true _ or Wang233 (i, j, 2) = true) THEN CALL Goes (i, j) end if next j next i 'walks double flying swallo for i = 0 to 15 for j = 0 to 15 if Comtrurn = True and Wantfour1 (i, j, 1) = TRUE THEN CALL GoES (i, J ) Endiff next j next i 'prevents eating for i = 0 to 15 for j = 0 to 15 if Comtrurn = True and Wantthree (i, j, 1) = TRUE THEN CALL GoES (i, J) End if Next J Next I '对 两 两 一 一 f = 0 to 15 for j = 0 to 15 if Comtrurn = True and Wantthree (i, j, 2) = TRUE THEN CALL GoES (i, j) Endiff next j next i 'Learn two points, one line for i = 0 to 15 for j = 0 to 15 if Comtrurn = true and table (i, j) = 0 and (Table (i - 1, j) * TABLE (i 1, j) = 1 _ or table (i - 1, j 1) * Table (i 1, j 1) = 1 _ or table (i, j - 1) * Table (i, j 1) =
1 _ or Table (i 1, j - 1) * Table (i - 1, j 1) = 1 _) THEN CALL GoES (i, j) end if next j next i 'broken for i = 0 to 15 For J = 0 to 15 if Comtrurn = True and Table (i, j) = 0 and (Table (i - 1, j) * Table (i 1, j) = 4 _ or table (i - 1, j 1) * TABLE (i 1, j 1) = 4 _ or table (i, j - 1) * Table (i, j 1) = 4 _ or table (i 1, j - 1) * TABLE (i - 1, j 1) = 4 _) THEN CAL L Goes (i, j) end if next j next i 'stick for i = 0 to 15 for j = 0 to 15 if Comtrurn = True and Table (i, j) = 1 and (Table (i - 1, j - 1) = 0 or Table (i, j - 1) = 0 or table (i 1, j - 1) = 0 or Table (i - 1, j) = 0 or table (i 1, j) = 0 OR Table (i - 1, j 1) = 0 or table (i, j 1) = 0 or table (i 1, j 1) = 0) THEN IF TABLE (i - 1, j - 1) = 0 THEN CALL GoES (I - 1, J - 1) Elseif Table (i 1, J 1) = 0 TEN CALL GoES (i 1, J 1) Elseif Table (i, j - 1) =
0 THEN CALL GoES (I, J - 1) Elseif Table (i, J 1) = 0 THEN CALL GoES (i, J 1) Elseif Table (i 1, J - 1) = 0 THEN CALL GoES (i 1, J - 1) Elseif Table (i - 1, j 1) = 0 THEN CALL GoES (i - 1, j 1) Elseif Table (i - 1, j) = 0 THEN CALL GoES (i - 1 , J) Elseif Table (i 1, j) = 0 THEN CALL GoES (i 1, j) end if end if next j next i 'will take a step end subprivate sub Form_paint ()' with (100,100) is the upper left corner Coordinate painting a 16 * 16, chess board for 300 per laby, 'clsdim x askledim y as singlex = 100Y = 100WHILE X <4300 x = x 300 line (x, 100) - (x, 4600) WendWhile Y < 4300 y = y 300 line (100, y) - (4600, y) Wendline (50, 50) - (50, 4650) LINE (50, 50) - (4650, 50) Line (50, 4650) - ( 4650, 4650) - (4650, 50) - LINE (100, 100) - (4600, 100) LINE (100, 100) - (100, 4600) LINE (4600, 100) - (4600, 4600) LINE (100, 4600) - (4600, 4600) End Sub
Private sub rules _Click () msgbox "Both sides turn from the son, the first five sons are connected to the first ray" End Sub
Private SUB Pioness _Click () BlackTurn = TrueWhiteturn = falsecomable = truecomturn = falsecomcolor = RGB (255, 255, 255) Restartend Sub
Private SUB_Click () BlackTurn = falseWhitturn = truecomable = truecomturn = truecomcolor = rgb (0, 0, 0) Restartend Sub