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