home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / Pente.dxr / 00033_gameMovie3.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  31.9 KB  |  587 lines

  1. global gGameBoard, gKounterH, gKounterV, gPosH, gPosV, gPuppeter, singleUndo, gPlaying, gSingleMove, gCompsTurn, gEKountH, gEKountV, gEMoves, gEWinX, gEWinY, gETrys, gEholdX, gEholdY, gELineH, gELineV, gELineHolder, gELineDirection, gEatmH, gEatmV, gEraseEnemy, gEraseFixH, gEraseFixV, gCapturedPlayer, gCapturedEnemy, gGo4WinV, gGo4WinH, gCheckPLines, gNuLine, gBalls, gNuMapPosX, gNuMapPosY, gKountY, gKountX, gSaveLength, gLineDot, gAdd5Xs, gKount2, gFullBoard, gSpecial, gPlayerHasEaten, gEnemyHasEaten
  2.  
  3. on PlayerMove
  4.   if gSingleMove = 1 then
  5.     if the mouseDown then
  6.       repeat with gKounterV = 1 to 13
  7.         repeat with gKounterH = 1 to 13
  8.           if gGameBoard[gKounterV][gKounterH] = 0 then
  9.             if (the mouseH < (58 + 12 + (gKounterH * 30))) and (the mouseH > (58 - 12 + (gKounterH * 30))) and (the mouseV > (9 - 12 + (gKounterV * 30))) and (the mouseV < (9 + 12 + (gKounterV * 30))) then
  10.               puppetSound(1, "move peg")
  11.               gPlayerHasEaten = 0
  12.               gEnemyHasEaten = 0
  13.               gGameBoard[gKounterV][gKounterH] = 1
  14.               gPosH = gKounterH
  15.               gPosV = gKounterV
  16.               gSingleMove = 0
  17.               if singleUndo = 1 then
  18.                 gCompsTurn = 1
  19.               end if
  20.               singleUndo = 1
  21.               sprite(gPuppeter).puppet = 1
  22.               sprite(gPuppeter).member = "black bead"
  23.               sprite(gPuppeter).loc = point(58 + (gKounterH * 30), 9 + (gKounterV * 30))
  24.               gPuppeter = gPuppeter + 1
  25.               updateStage()
  26.             end if
  27.           end if
  28.         end repeat
  29.       end repeat
  30.     end if
  31.   end if
  32.   if the mouseUp then
  33.     gSingleMove = 1
  34.   end if
  35. end
  36.  
  37. on AI_Block
  38.   repeat with gGo4WinV = 1 to 13
  39.     repeat with gGo4WinH = 1 to 13
  40.       if gGameBoard[gGo4WinV][gGo4WinH] = 1 then
  41.         if gGo4WinH <= 9 then
  42.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) then
  43.             gBalls = 2
  44.           end if
  45.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 0) then
  46.             gBalls = 3
  47.           end if
  48.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 0) then
  49.             gBalls = 4
  50.           end if
  51.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 1) then
  52.             gBalls = 4
  53.             gSpecial = 2
  54.           end if
  55.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 1) then
  56.             gBalls = 3
  57.             gSpecial = 1
  58.           end if
  59.           if ((gGameBoard[gGo4WinV][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 1)) or ((gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 1)) then
  60.             gBalls = 0
  61.             gSpecial = 0
  62.             put "distaste Right1"
  63.           end if
  64.           if gGo4WinH <= 8 then
  65.             if ((gGameBoard[gGo4WinV][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 1)) or ((gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 1)) or ((gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 5] = 1)) then
  66.               gBalls = 0
  67.               gSpecial = 0
  68.               put "distaste Right2"
  69.             end if
  70.           end if
  71.         else
  72.           if gGo4WinH = 10 then
  73.             if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) then
  74.               gBalls = 2
  75.               if (gGameBoard[gGo4WinV][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 3] <> 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 0) then
  76.                 gBalls = 3
  77.               end if
  78.             end if
  79.             if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 1) then
  80.               gBalls = 0
  81.               gSpecial = 0
  82.               put "distaste Right3"
  83.             end if
  84.           else
  85.             if gGo4WinH = 11 then
  86.               if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) then
  87.                 gBalls = 2
  88.               end if
  89.             end if
  90.           end if
  91.         end if
  92.         if gBalls >= gSaveLength then
  93.           gNuMapPosY = gGo4WinV
  94.           gNuMapPosX = gGo4WinH + (gBalls - gSpecial)
  95.           gSaveLength = gBalls
  96.           gEKountV = gNuMapPosY
  97.           gEKountH = gNuMapPosX
  98.         end if
  99.         gBalls = 1
  100.         gSpecial = 0
  101.         if (gGo4WinH <= 9) and (gGo4WinV >= 5) then
  102.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) then
  103.             gBalls = 2
  104.           end if
  105.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 0) then
  106.             gBalls = 3
  107.           end if
  108.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 0) then
  109.             gBalls = 4
  110.           end if
  111.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 1) then
  112.             gBalls = 4
  113.             gSpecial = 2
  114.           end if
  115.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 1) then
  116.             gBalls = 3
  117.             gSpecial = 1
  118.           end if
  119.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 1) then
  120.             gBalls = 1
  121.             gSpecial = 0
  122.           end if
  123.           if ((gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 1)) then
  124.             gBalls = 0
  125.             gSpecial = 0
  126.             put "distaste Up&Right1"
  127.           end if
  128.           if (gGo4WinH <= 8) and (gGo4WinV >= 6) then
  129.             if ((gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 0) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 2) and (gGameBoard[gGo4WinV - 5][gGo4WinH + 5] = 1)) then
  130.               gBalls = 0
  131.               gSpecial = 0
  132.               put "distaste Up&Right2"
  133.             end if
  134.           end if
  135.         else
  136.           if (gGo4WinH = 10) and (gGo4WinV = 4) then
  137.             if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) then
  138.               gBalls = 2
  139.               if (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] <> 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 0) then
  140.                 gBalls = 3
  141.               end if
  142.             end if
  143.             if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 1) then
  144.               gBalls = 1
  145.               gSpecial = 0
  146.               put "distaste Up&Right3"
  147.             end if
  148.           else
  149.             if (gGo4WinH = 11) and (gGo4WinV = 3) then
  150.               if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) then
  151.                 gBalls = 2
  152.               end if
  153.             end if
  154.           end if
  155.         end if
  156.         if gBalls >= gSaveLength then
  157.           gNuMapPosY = gGo4WinV - (gBalls - gSpecial)
  158.           gNuMapPosX = gGo4WinH + (gBalls - gSpecial)
  159.           gSaveLength = gBalls
  160.           gEKountV = gNuMapPosY
  161.           gEKountH = gNuMapPosX
  162.         end if
  163.         gBalls = 1
  164.         gSpecial = 0
  165.         if gGo4WinV >= 5 then
  166.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) then
  167.             gBalls = 2
  168.           end if
  169.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 0) then
  170.             gBalls = 3
  171.           end if
  172.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 0) then
  173.             gBalls = 4
  174.           end if
  175.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 1) then
  176.             gBalls = 4
  177.             gSpecial = 2
  178.           end if
  179.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 1) then
  180.             gBalls = 3
  181.             gSpecial = 1
  182.           end if
  183.           if ((gGameBoard[gGo4WinV - 1][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 1)) then
  184.             gBalls = 0
  185.             gSpecial = 0
  186.             put "distaste Up1"
  187.           end if
  188.           if gGo4WinV >= 6 then
  189.             if ((gGameBoard[gGo4WinV - 1][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 5][gGo4WinH] = 1)) then
  190.               gBalls = 0
  191.               gSpecial = 0
  192.               put "distaste Up2"
  193.             end if
  194.           end if
  195.         else
  196.           if gGo4WinV = 4 then
  197.             if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) then
  198.               gBalls = 2
  199.               if (gGameBoard[gGo4WinV - 2][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH] <> 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 0) then
  200.                 gBalls = 3
  201.               end if
  202.             end if
  203.             if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 1) then
  204.               gBalls = 1
  205.               gSpecial = 0
  206.               put "distaste Up3"
  207.             end if
  208.           else
  209.             if gGo4WinV = 3 then
  210.               if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) then
  211.                 gBalls = 2
  212.               end if
  213.             end if
  214.           end if
  215.         end if
  216.         if gBalls >= gSaveLength then
  217.           gNuMapPosY = gGo4WinV - (gBalls - gSpecial)
  218.           gNuMapPosX = gGo4WinH
  219.           gSaveLength = gBalls
  220.           gEKountV = gNuMapPosY
  221.           gEKountH = gNuMapPosX
  222.         end if
  223.         gBalls = 1
  224.         gSpecial = 0
  225.         if (gGo4WinH >= 5) and (gGo4WinV >= 5) then
  226.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) then
  227.             gBalls = 2
  228.           end if
  229.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 0) then
  230.             gBalls = 3
  231.           end if
  232.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 0) then
  233.             gBalls = 4
  234.           end if
  235.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 1) then
  236.             gBalls = 4
  237.             gSpecial = 2
  238.           end if
  239.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 1) then
  240.             gBalls = 3
  241.             gSpecial = 1
  242.           end if
  243.           if ((gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 1)) then
  244.             gBalls = 0
  245.             gSpecial = 0
  246.             put "distaste Up&Left1"
  247.           end if
  248.           if (gGo4WinH >= 6) and (gGo4WinV >= 6) then
  249.             if ((gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 1)) or ((gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 0) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 2) and (gGameBoard[gGo4WinV - 5][gGo4WinH - 5] = 1)) then
  250.               gBalls = 0
  251.               gSpecial = 0
  252.               put "distaste Up&Left2"
  253.             end if
  254.           end if
  255.         else
  256.           if (gGo4WinH = 4) and (gGo4WinV = 4) then
  257.             if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) then
  258.               gBalls = 2
  259.               if (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] <> 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 0) then
  260.                 gBalls = 3
  261.               end if
  262.             end if
  263.             if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 1) then
  264.               gBalls = 1
  265.               gSpecial = 0
  266.               put "distaste Up&Left3"
  267.             end if
  268.           else
  269.             if (gGo4WinH = 3) and (gGo4WinV = 3) then
  270.               if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) then
  271.                 gBalls = 2
  272.               end if
  273.             end if
  274.           end if
  275.         end if
  276.         if gBalls >= gSaveLength then
  277.           gNuMapPosY = gGo4WinV - (gBalls - gSpecial)
  278.           gNuMapPosX = gGo4WinH - (gBalls - gSpecial)
  279.           gSaveLength = gBalls
  280.           gEKountV = gNuMapPosY
  281.           gEKountH = gNuMapPosX
  282.         end if
  283.         gBalls = 1
  284.         gSpecial = 0
  285.         if gGo4WinH >= 5 then
  286.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) then
  287.             gBalls = 2
  288.           end if
  289.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 0) then
  290.             gBalls = 3
  291.           end if
  292.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 0) then
  293.             gBalls = 4
  294.           end if
  295.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 1) then
  296.             gBalls = 4
  297.             gSpecial = 2
  298.           end if
  299.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 1) then
  300.             gBalls = 3
  301.             gSpecial = 1
  302.           end if
  303.           if ((gGameBoard[gGo4WinV][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 1)) or ((gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 1)) then
  304.             gBalls = 0
  305.             gSpecial = 0
  306.             put "distaste Left1"
  307.           end if
  308.           if gGo4WinH >= 6 then
  309.             if ((gGameBoard[gGo4WinV][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 1)) or ((gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 1)) or ((gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 5] = 1)) then
  310.               gBalls = 0
  311.               gSpecial = 0
  312.               put "distaste Left2"
  313.             end if
  314.           end if
  315.         else
  316.           if gGo4WinH = 4 then
  317.             if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) then
  318.               gBalls = 2
  319.               if (gGameBoard[gGo4WinV][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 3] <> 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 0) then
  320.                 gBalls = 3
  321.               end if
  322.             end if
  323.             if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 1) then
  324.               gBalls = 0
  325.               gSpecial = 0
  326.               put "distaste Left3"
  327.             end if
  328.           else
  329.             if gGo4WinH = 3 then
  330.               if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) then
  331.                 gBalls = 2
  332.               end if
  333.             end if
  334.           end if
  335.         end if
  336.         if gBalls >= gSaveLength then
  337.           gNuMapPosY = gGo4WinV
  338.           gNuMapPosX = gGo4WinH - (gBalls - gSpecial)
  339.           gSaveLength = gBalls
  340.           gEKountV = gNuMapPosY
  341.           gEKountH = gNuMapPosX
  342.         end if
  343.         gBalls = 1
  344.         gSpecial = 0
  345.         if (gGo4WinH >= 5) and (gGo4WinV <= 9) then
  346.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) then
  347.             gBalls = 2
  348.           end if
  349.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 0) then
  350.             gBalls = 3
  351.           end if
  352.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 0) then
  353.             gBalls = 4
  354.           end if
  355.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 1) then
  356.             gBalls = 4
  357.             gSpecial = 2
  358.           end if
  359.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 1) then
  360.             gBalls = 3
  361.             gSpecial = 1
  362.           end if
  363.           if ((gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 1)) then
  364.             gBalls = 0
  365.             gSpecial = 0
  366.             put "distaste Down&Left1"
  367.           end if
  368.           if (gGo4WinH >= 6) and (gGo4WinV <= 8) then
  369.             if ((gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 0) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 2) and (gGameBoard[gGo4WinV + 5][gGo4WinH - 5] = 1)) then
  370.               gBalls = 0
  371.               gSpecial = 0
  372.               put "distaste Down&Left2"
  373.             end if
  374.           end if
  375.         else
  376.           if (gGo4WinH = 4) and (gGo4WinV = 10) then
  377.             if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) then
  378.               gBalls = 2
  379.               if (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] <> 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 0) then
  380.                 gBalls = 3
  381.               end if
  382.             end if
  383.             if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 1) then
  384.               gBalls = 1
  385.               gSpecial = 0
  386.               put "distaste Down&Left3"
  387.             end if
  388.           else
  389.             if (gGo4WinH = 3) and (gGo4WinV = 11) then
  390.               if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) then
  391.                 gBalls = 2
  392.               end if
  393.             end if
  394.           end if
  395.         end if
  396.         if gBalls >= gSaveLength then
  397.           gNuMapPosY = gGo4WinV + (gBalls - gSpecial)
  398.           gNuMapPosX = gGo4WinH - (gBalls - gSpecial)
  399.           gSaveLength = gBalls
  400.           gEKountV = gNuMapPosY
  401.           gEKountH = gNuMapPosX
  402.         end if
  403.         gBalls = 1
  404.         gSpecial = 0
  405.         if gGo4WinV <= 9 then
  406.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) then
  407.             gBalls = 2
  408.           end if
  409.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 0) then
  410.             gBalls = 3
  411.           end if
  412.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 0) then
  413.             gBalls = 4
  414.           end if
  415.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 1) then
  416.             gBalls = 4
  417.             gSpecial = 2
  418.           end if
  419.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 1) then
  420.             gBalls = 3
  421.             gSpecial = 1
  422.           end if
  423.           if ((gGameBoard[gGo4WinV + 1][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 1)) then
  424.             gBalls = 0
  425.             gSpecial = 0
  426.             put "distaste Down1"
  427.           end if
  428.           if gGo4WinV <= 8 then
  429.             if ((gGameBoard[gGo4WinV + 1][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 5][gGo4WinH] = 1)) then
  430.               gBalls = 0
  431.               gSpecial = 0
  432.               put "distaste Down2"
  433.             end if
  434.           end if
  435.         else
  436.           if gGo4WinV = 10 then
  437.             if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) then
  438.               gBalls = 2
  439.               if (gGameBoard[gGo4WinV + 2][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH] <> 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 0) then
  440.                 gBalls = 3
  441.               end if
  442.             end if
  443.             if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 1) then
  444.               gBalls = 1
  445.               gSpecial = 0
  446.               put "distaste Down3"
  447.             end if
  448.           else
  449.             if gGo4WinV = 11 then
  450.               if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) then
  451.                 gBalls = 2
  452.               end if
  453.             end if
  454.           end if
  455.         end if
  456.         if gBalls >= gSaveLength then
  457.           gNuMapPosY = gGo4WinV + (gBalls - gSpecial)
  458.           gNuMapPosX = gGo4WinH
  459.           gSaveLength = gBalls
  460.           gEKountV = gNuMapPosY
  461.           gEKountH = gNuMapPosX
  462.         end if
  463.         gBalls = 1
  464.         gSpecial = 0
  465.         if (gGo4WinH <= 9) and (gGo4WinV <= 9) then
  466.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) then
  467.             gBalls = 2
  468.           end if
  469.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 0) then
  470.             gBalls = 3
  471.           end if
  472.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 0) then
  473.             gBalls = 4
  474.           end if
  475.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 1) then
  476.             gBalls = 4
  477.             gSpecial = 2
  478.           end if
  479.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 1) then
  480.             gBalls = 3
  481.             gSpecial = 1
  482.           end if
  483.           if ((gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 1)) then
  484.             gBalls = 0
  485.             gSpecial = 0
  486.             put "distaste Down&Right1"
  487.           end if
  488.           if (gGo4WinH <= 8) and (gGo4WinV <= 8) then
  489.             if ((gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 1)) or ((gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 0) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 2) and (gGameBoard[gGo4WinV + 5][gGo4WinH + 5] = 1)) then
  490.               gBalls = 0
  491.               gSpecial = 0
  492.               put "distaste Down&Right2"
  493.             end if
  494.           end if
  495.         else
  496.           if (gGo4WinH = 10) and (gGo4WinV = 10) then
  497.             if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) then
  498.               gBalls = 2
  499.               if (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] <> 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 0) then
  500.                 gBalls = 3
  501.               end if
  502.             end if
  503.             if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 0) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 1) then
  504.               gBalls = 1
  505.               gSpecial = 0
  506.               put "distaste Down&Right3"
  507.             end if
  508.           else
  509.             if (gGo4WinH = 11) and (gGo4WinV = 11) then
  510.               if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] <> 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) then
  511.                 gBalls = 2
  512.               end if
  513.             end if
  514.           end if
  515.         end if
  516.         if gBalls >= gSaveLength then
  517.           gNuMapPosY = gGo4WinV + (gBalls - gSpecial)
  518.           gNuMapPosX = gGo4WinH + (gBalls - gSpecial)
  519.           gSaveLength = gBalls
  520.           gEKountV = gNuMapPosY
  521.           gEKountH = gNuMapPosX
  522.         end if
  523.         gBalls = 1
  524.         gSpecial = 0
  525.       end if
  526.     end repeat
  527.   end repeat
  528.   if gSaveLength <= 2 then
  529.     EnemyGo4Win()
  530.   end if
  531.   gSaveLength = 1
  532. end
  533.  
  534. on AI_Build
  535.   if gEMoves <= 1 then
  536.     selectLine()
  537.     gEKountV = gELineV
  538.     gEKountH = gELineH
  539.   else
  540.     repeat while gGameBoard[gELineV][gELineH] <> 0
  541.       case gELineDirection of
  542.         6:
  543.           Direction_Right()
  544.         9:
  545.           Direction_Up_Right()
  546.         8:
  547.           Direction_Up()
  548.         7:
  549.           Direction_Up_Left()
  550.         4:
  551.           Direction_Left()
  552.         1:
  553.           Direction_Down_Left()
  554.         2:
  555.           Direction_Down()
  556.         3:
  557.           Direction_Down_Right()
  558.         5:
  559.           Direction_Right()
  560.       end case
  561.     end repeat
  562.   end if
  563.   gEKountV = gELineV
  564.   gEKountH = gELineH
  565. end
  566.  
  567. on selectLine
  568.   gELineV = random(5) + 4
  569.   gELineH = random(5) + 4
  570. end
  571.  
  572. on AI_Random
  573.   gEKountV = random(13)
  574.   gEKountH = random(13)
  575.   repeat while gGameBoard[gEKountV][gEKountH] <> 0
  576.     gEKountV = random(13)
  577.     gEKountH = random(13)
  578.     if gFullBoard >= 169 then
  579.       gFullBoard = 0
  580.       gPlaying = 0
  581.       go(37)
  582.       put "4"
  583.     end if
  584.     put "0"
  585.   end repeat
  586. end
  587.