home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / ProGoMoku.dxr / 00048_gameMovie5.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  24.4 KB  |  447 lines

  1. global gGameBoard, gKounterH, gKounterV, gPosH, gPosV, gPuppeter, singleUndo, gPlaying, gSingleMove, gCompsTurn, gEKountH, gEKountV, gEPuppet, gEMoves, gEWinX, gEWinY, gETrys, gEholdX, gEholdY, gELineH, gELineV, gELineHolder, gELineDirection, gGo4WinV, gGo4WinH, gCheckPLines, gNuLine, gEBalls, gNuMapPosX, gNuMapPosY, gKountY, gKountX, gESaveLength, gLineDot, gAdd5Xs, gKount2, gFullBoard, gSpecial
  2.  
  3. on EnemyGo4Win
  4.   repeat with gGo4WinV = 1 to 15
  5.     repeat with gGo4WinH = 1 to 15
  6.       if gGameBoard[gGo4WinV][gGo4WinH] = 2 then
  7.         if gGo4WinH <= 10 then
  8.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) then
  9.             gEBalls = 2
  10.           end if
  11.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 0) then
  12.             gEBalls = 3
  13.           end if
  14.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 0) then
  15.             gEBalls = 4
  16.           end if
  17.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 5] = 0) then
  18.             gEBalls = 5
  19.           end if
  20.           if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 2) then
  21.             gBalls = 4
  22.             gSpecial = 2
  23.           end if
  24.         else
  25.           if gGo4WinH = 11 then
  26.             if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) then
  27.               gEBalls = 2
  28.               if (gGameBoard[gGo4WinV][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 0) then
  29.                 gEBalls = 3
  30.                 if (gGameBoard[gGo4WinV][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 4] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH + 4] = 0) then
  31.                   gEBalls = 4
  32.                 end if
  33.               end if
  34.             end if
  35.           else
  36.             if gGo4WinH = 12 then
  37.               if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) then
  38.                 gEBalls = 2
  39.                 if (gGameBoard[gGo4WinV][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 3] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH + 3] = 0) then
  40.                   gEBalls = 3
  41.                 end if
  42.               end if
  43.             else
  44.               if gGo4WinH = 13 then
  45.                 if (gGameBoard[gGo4WinV][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH + 2] = 0) then
  46.                   gEBalls = 2
  47.                 end if
  48.               end if
  49.             end if
  50.           end if
  51.         end if
  52.         if gEBalls > gESaveLength then
  53.           gNuMapPosY = gGo4WinV
  54.           gNuMapPosX = gGo4WinH + (gEBalls - gSpecial)
  55.           gESaveLength = gEBalls
  56.           gEKountV = gNuMapPosY
  57.           gEKountH = gNuMapPosX
  58.         end if
  59.         gEBalls = 1
  60.         gSpecial = 0
  61.         if (gGo4WinH <= 10) and (gGo4WinV >= 6) then
  62.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) then
  63.             gEBalls = 2
  64.           end if
  65.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 0) then
  66.             gEBalls = 3
  67.           end if
  68.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 0) then
  69.             gEBalls = 4
  70.           end if
  71.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 2) and (gGameBoard[gGo4WinV - 5][gGo4WinH + 5] = 0) then
  72.             gEBalls = 5
  73.           end if
  74.           if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 2) then
  75.             gBalls = 4
  76.             gSpecial = 2
  77.           end if
  78.         else
  79.           if (gGo4WinH = 11) and (gGo4WinV = 5) then
  80.             if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) then
  81.               gEBalls = 2
  82.               if (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] <> 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 0) then
  83.                 gEBalls = 3
  84.                 if (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] <> 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH + 4] = 0) then
  85.                   gEBalls = 4
  86.                 end if
  87.               end if
  88.             end if
  89.           else
  90.             if (gGo4WinH = 12) and (gGo4WinV = 4) then
  91.               if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) then
  92.                 gEBalls = 2
  93.                 if (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] <> 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH + 3] = 0) then
  94.                   gEBalls = 3
  95.                 end if
  96.               end if
  97.             else
  98.               if (gGo4WinH = 13) and (gGo4WinV = 3) then
  99.                 if (gGameBoard[gGo4WinV - 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH + 2] = 0) then
  100.                   gEBalls = 2
  101.                 end if
  102.               end if
  103.             end if
  104.           end if
  105.         end if
  106.         if gEBalls > gESaveLength then
  107.           gNuMapPosY = gGo4WinV - (gEBalls - gSpecial)
  108.           gNuMapPosX = gGo4WinH + (gEBalls - gSpecial)
  109.           gESaveLength = gEBalls
  110.           gEKountV = gNuMapPosY
  111.           gEKountH = gNuMapPosX
  112.         end if
  113.         gEBalls = 1
  114.         gSpecial = 0
  115.         if gGo4WinV >= 6 then
  116.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) then
  117.             gEBalls = 2
  118.           end if
  119.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 0) then
  120.             gEBalls = 3
  121.           end if
  122.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 0) then
  123.             gEBalls = 4
  124.           end if
  125.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 5][gGo4WinH] = 0) then
  126.             gEBalls = 5
  127.           end if
  128.           if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 2) then
  129.             gBalls = 4
  130.             gSpecial = 2
  131.           end if
  132.         else
  133.           if gGo4WinV = 5 then
  134.             if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) then
  135.               gEBalls = 2
  136.               if (gGameBoard[gGo4WinV - 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 0) then
  137.                 gEBalls = 3
  138.                 if (gGameBoard[gGo4WinV - 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH] = 0) then
  139.                   gEBalls = 4
  140.                 end if
  141.               end if
  142.             end if
  143.           else
  144.             if gGo4WinV = 4 then
  145.               if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) then
  146.                 gEBalls = 2
  147.                 if (gGameBoard[gGo4WinV - 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH] = 0) then
  148.                   gEBalls = 3
  149.                 end if
  150.               end if
  151.             else
  152.               if gGo4WinV = 3 then
  153.                 if (gGameBoard[gGo4WinV - 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH] = 0) then
  154.                   gEBalls = 2
  155.                 end if
  156.               end if
  157.             end if
  158.           end if
  159.         end if
  160.         if gEBalls > gESaveLength then
  161.           gNuMapPosY = gGo4WinV - (gEBalls - gSpecial)
  162.           gNuMapPosX = gGo4WinH
  163.           gESaveLength = gEBalls
  164.           gEKountV = gNuMapPosY
  165.           gEKountH = gNuMapPosX
  166.         end if
  167.         gEBalls = 1
  168.         gSpecial = 0
  169.         if (gGo4WinH >= 6) and (gGo4WinV >= 6) then
  170.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) then
  171.             gEBalls = 2
  172.           end if
  173.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 0) then
  174.             gEBalls = 3
  175.           end if
  176.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 0) then
  177.             gEBalls = 4
  178.           end if
  179.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 2) and (gGameBoard[gGo4WinV - 5][gGo4WinH - 5] = 0) then
  180.             gEBalls = 5
  181.           end if
  182.           if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 2) then
  183.             gBalls = 4
  184.             gSpecial = 2
  185.           end if
  186.         else
  187.           if (gGo4WinH = 5) and (gGo4WinV = 5) then
  188.             if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) then
  189.               gEBalls = 2
  190.               if (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] <> 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 0) then
  191.                 gEBalls = 3
  192.                 if (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] <> 1) and (gGameBoard[gGo4WinV - 4][gGo4WinH - 4] = 0) then
  193.                   gEBalls = 4
  194.                 end if
  195.               end if
  196.             end if
  197.           else
  198.             if (gGo4WinH = 4) and (gGo4WinV = 4) then
  199.               if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) then
  200.                 gEBalls = 2
  201.                 if (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] <> 1) and (gGameBoard[gGo4WinV - 3][gGo4WinH - 3] = 0) then
  202.                   gEBalls = 3
  203.                 end if
  204.               end if
  205.             else
  206.               if (gGo4WinH = 3) and (gGo4WinV = 3) then
  207.                 if (gGameBoard[gGo4WinV - 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV - 2][gGo4WinH - 2] = 0) then
  208.                   gEBalls = 2
  209.                 end if
  210.               end if
  211.             end if
  212.           end if
  213.         end if
  214.         if gEBalls > gESaveLength then
  215.           gNuMapPosY = gGo4WinV - (gEBalls - gSpecial)
  216.           gNuMapPosX = gGo4WinH - (gEBalls - gSpecial)
  217.           gESaveLength = gEBalls
  218.           gEKountV = gNuMapPosY
  219.           gEKountH = gNuMapPosX
  220.         end if
  221.         gEBalls = 1
  222.         gSpecial = 0
  223.         if gGo4WinH >= 6 then
  224.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) then
  225.             gEBalls = 2
  226.           end if
  227.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 0) then
  228.             gEBalls = 3
  229.           end if
  230.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 0) then
  231.             gEBalls = 4
  232.           end if
  233.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 5] = 0) then
  234.             gEBalls = 5
  235.           end if
  236.           if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 2) then
  237.             gBalls = 4
  238.             gSpecial = 2
  239.           end if
  240.         else
  241.           if gGo4WinH = 5 then
  242.             if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) then
  243.               gEBalls = 2
  244.               if (gGameBoard[gGo4WinV][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 0) then
  245.                 gEBalls = 3
  246.                 if (gGameBoard[gGo4WinV][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 4] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH - 4] = 0) then
  247.                   gEBalls = 4
  248.                 end if
  249.               end if
  250.             end if
  251.           else
  252.             if gGo4WinH = 4 then
  253.               if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) then
  254.                 gEBalls = 2
  255.                 if (gGameBoard[gGo4WinV][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 3] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH - 3] = 0) then
  256.                   gEBalls = 3
  257.                 end if
  258.               end if
  259.             else
  260.               if gGo4WinH = 3 then
  261.                 if (gGameBoard[gGo4WinV][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV][gGo4WinH - 2] = 0) then
  262.                   gEBalls = 2
  263.                 end if
  264.               end if
  265.             end if
  266.           end if
  267.         end if
  268.         if gEBalls > gESaveLength then
  269.           gNuMapPosY = gGo4WinV
  270.           gNuMapPosX = gGo4WinH - (gEBalls - gSpecial)
  271.           gESaveLength = gEBalls
  272.           gEKountV = gNuMapPosY
  273.           gEKountH = gNuMapPosX
  274.         end if
  275.         gEBalls = 1
  276.         gSpecial = 0
  277.         if (gGo4WinH >= 6) and (gGo4WinV <= 10) then
  278.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) then
  279.             gEBalls = 2
  280.           end if
  281.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 0) then
  282.             gEBalls = 3
  283.           end if
  284.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 0) then
  285.             gEBalls = 4
  286.           end if
  287.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 2) and (gGameBoard[gGo4WinV + 5][gGo4WinH - 5] = 0) then
  288.             gEBalls = 5
  289.           end if
  290.           if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 2) then
  291.             gBalls = 4
  292.             gSpecial = 2
  293.           end if
  294.         else
  295.           if (gGo4WinH = 5) and (gGo4WinV = 11) then
  296.             if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) then
  297.               gEBalls = 2
  298.               if (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] <> 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 0) then
  299.                 gEBalls = 3
  300.                 if (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] <> 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH - 4] = 0) then
  301.                   gEBalls = 4
  302.                 end if
  303.               end if
  304.             end if
  305.           else
  306.             if (gGo4WinH = 4) and (gGo4WinV = 12) then
  307.               if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) then
  308.                 gEBalls = 2
  309.                 if (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] <> 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH - 3] = 0) then
  310.                   gEBalls = 3
  311.                 end if
  312.               end if
  313.             else
  314.               if (gGo4WinH = 3) and (gGo4WinV = 13) then
  315.                 if (gGameBoard[gGo4WinV + 1][gGo4WinH - 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH - 2] = 0) then
  316.                   gEBalls = 2
  317.                 end if
  318.               end if
  319.             end if
  320.           end if
  321.         end if
  322.         if gEBalls > gESaveLength then
  323.           gNuMapPosY = gGo4WinV + (gEBalls - gSpecial)
  324.           gNuMapPosX = gGo4WinH - (gEBalls - gSpecial)
  325.           gESaveLength = gEBalls
  326.           gEKountV = gNuMapPosY
  327.           gEKountH = gNuMapPosX
  328.         end if
  329.         gEBalls = 1
  330.         gSpecial = 0
  331.         if gGo4WinV <= 10 then
  332.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) then
  333.             gEBalls = 2
  334.           end if
  335.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 0) then
  336.             gEBalls = 3
  337.           end if
  338.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 0) then
  339.             gEBalls = 4
  340.           end if
  341.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 5][gGo4WinH] = 0) then
  342.             gEBalls = 5
  343.           end if
  344.           if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 2) then
  345.             gBalls = 4
  346.             gSpecial = 2
  347.           end if
  348.         else
  349.           if gGo4WinV = 11 then
  350.             if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) then
  351.               gEBalls = 2
  352.               if (gGameBoard[gGo4WinV + 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 0) then
  353.                 gEBalls = 3
  354.                 if (gGameBoard[gGo4WinV + 3][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH] = 0) then
  355.                   gEBalls = 4
  356.                 end if
  357.               end if
  358.             end if
  359.           else
  360.             if gGo4WinV = 12 then
  361.               if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) then
  362.                 gEBalls = 2
  363.                 if (gGameBoard[gGo4WinV + 2][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH] = 0) then
  364.                   gEBalls = 3
  365.                 end if
  366.               end if
  367.             else
  368.               if gGo4WinV = 13 then
  369.                 if (gGameBoard[gGo4WinV + 1][gGo4WinH] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH] = 0) then
  370.                   gEBalls = 2
  371.                 end if
  372.               end if
  373.             end if
  374.           end if
  375.         end if
  376.         if gEBalls > gESaveLength then
  377.           gNuMapPosY = gGo4WinV + (gEBalls - gSpecial)
  378.           gNuMapPosX = gGo4WinH
  379.           gESaveLength = gEBalls
  380.           gEKountV = gNuMapPosY
  381.           gEKountH = gNuMapPosX
  382.         end if
  383.         gEBalls = 1
  384.         gSpecial = 0
  385.         if (gGo4WinH <= 10) and (gGo4WinV <= 10) then
  386.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) then
  387.             gEBalls = 2
  388.           end if
  389.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 0) then
  390.             gEBalls = 3
  391.           end if
  392.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 0) then
  393.             gEBalls = 4
  394.           end if
  395.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 2) and (gGameBoard[gGo4WinV + 5][gGo4WinH + 5] = 0) then
  396.             gEBalls = 5
  397.           end if
  398.           if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 2) then
  399.             gBalls = 4
  400.             gSpecial = 2
  401.           end if
  402.         else
  403.           if (gGo4WinH = 11) and (gGo4WinV = 11) then
  404.             if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) then
  405.               gEBalls = 2
  406.               if (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] <> 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 0) then
  407.                 gEBalls = 3
  408.                 if (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 2) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] <> 1) and (gGameBoard[gGo4WinV + 4][gGo4WinH + 4] = 0) then
  409.                   gEBalls = 4
  410.                 end if
  411.               end if
  412.             end if
  413.           else
  414.             if (gGo4WinH = 12) and (gGo4WinV = 12) then
  415.               if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) then
  416.                 gEBalls = 2
  417.                 if (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 2) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] <> 1) and (gGameBoard[gGo4WinV + 3][gGo4WinH + 3] = 0) then
  418.                   gEBalls = 3
  419.                 end if
  420.               end if
  421.             else
  422.               if (gGo4WinH = 13) and (gGo4WinV = 13) then
  423.                 if (gGameBoard[gGo4WinV + 1][gGo4WinH + 1] = 2) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] <> 1) and (gGameBoard[gGo4WinV + 2][gGo4WinH + 2] = 0) then
  424.                   gEBalls = 2
  425.                 end if
  426.               end if
  427.             end if
  428.           end if
  429.         end if
  430.         if gEBalls > gESaveLength then
  431.           gNuMapPosY = gGo4WinV + (gEBalls - gSpecial)
  432.           gNuMapPosX = gGo4WinH + (gEBalls - gSpecial)
  433.           gESaveLength = gEBalls
  434.           gEKountV = gNuMapPosY
  435.           gEKountH = gNuMapPosX
  436.         end if
  437.         gEBalls = 1
  438.         gSpecial = 0
  439.       end if
  440.     end repeat
  441.   end repeat
  442.   if gESaveLength <= 2 then
  443.     AI_Build()
  444.   end if
  445.   gESaveLength = 1
  446. end
  447.