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