Advertisement
SerGe3

Blob Wars - Source Code - FULL - SWF Reverse

Mar 18th, 2019
1,624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // Action script...
  3.  
  4. // [onClipEvent of sprite 13 in frame 1]
  5. onClipEvent (initialize)
  6. {
  7.     STREAM = true;
  8.     PLAY_TYPE = "bytes";
  9.     PLAY_BYTES = 10000;
  10.     PLAY_FRAMES = 0;
  11.     PLAY_PERCENTAGE = 0;
  12. }
  13.  
  14. // [onClipEvent of sprite 18 in frame 1]
  15. onClipEvent (load)
  16. {
  17.     var myStartWidth = this._width;
  18.     this._width = 0;
  19. }
  20.  
  21. // [onClipEvent of sprite 18 in frame 1]
  22. onClipEvent (enterFrame)
  23. {
  24.     this._width = myStartWidth * _root.mc_load_info.fractionLoaded;
  25. }
  26.  
  27. // [onClipEvent of sprite 134 in frame 6]
  28. onClipEvent (load)
  29. {
  30.     function updateScrollbar()
  31.     {
  32.         content._y = -(scroller._y - top) / diff_y * (content._height - bound_box._height);
  33.     } // End of the function
  34.     diff_y = bound_box._height - scroller._height;
  35.     bounds = bound_box.getBounds(this);
  36.     top = bounds.yMin + scroller._height / 2;
  37.     bottom = bounds.yMax - scroller._height / 2;
  38.     friction = 0;
  39. }
  40.  
  41. // [onClipEvent of sprite 134 in frame 6]
  42. onClipEvent (mouseDown)
  43. {
  44.     if (scroller.hitTest(_root._xmouse, _root._ymouse))
  45.     {
  46.         startDrag ("scroller", false, scroller._x, top, scroller._x, bottom);
  47.         scrolling = true;
  48.     } // end if
  49. }
  50.  
  51. // [onClipEvent of sprite 134 in frame 6]
  52. onClipEvent (mouseUp)
  53. {
  54.     stopDrag ();
  55.     scrolling = false;
  56. }
  57.  
  58. // [onClipEvent of sprite 134 in frame 6]
  59. onClipEvent (enterFrame)
  60. {
  61.     if (scrolling)
  62.     {
  63.         updateScrollbar();
  64.         newY = scroller._y;
  65.         yspeed = (newY - oldY) * 0.500000;
  66.         oldY = newY;
  67.         done = false;
  68.     }
  69.     else if (!done)
  70.     {
  71.         oldypos = scroller._y;
  72.         newypos = oldypos + yspeed;
  73.         if (yspeed < -0.200000 || yspeed > 0.200000)
  74.         {
  75.             yspeed = yspeed * friction;
  76.         }
  77.         else
  78.         {
  79.             yspeed = 0;
  80.             done = true;
  81.         } // end else if
  82.         if (newypos < top)
  83.         {
  84.             yspeed = -1 * yspeed * friction;
  85.             newypos = top;
  86.         } // end if
  87.         if (newypos > bottom)
  88.         {
  89.             yspeed = -1 * yspeed * friction;
  90.             newypos = bottom;
  91.         } // end if
  92.         scroller._y = newypos;
  93.         updateScrollbar();
  94.     } // end else if
  95. }
  96.  
  97. // [onClipEvent of sprite 158 in frame 33]
  98. onClipEvent (enterFrame)
  99. {
  100.     if (_root.whoseGo == _root.PLAYER)
  101.     {
  102.     } // end if
  103. }
  104.  
  105. // [onClipEvent of sprite 160 in frame 33]
  106. onClipEvent (enterFrame)
  107. {
  108.     if (_root.whoseGo == _root.PLAYER)
  109.     {
  110.     } // end if
  111. }
  112.  
  113. // [onClipEvent of sprite 158 in frame 34]
  114. onClipEvent (enterFrame)
  115. {
  116.     if (_root.whoseGo == _root.PLAYER)
  117.     {
  118.     } // end if
  119. }
  120.  
  121. // [onClipEvent of sprite 160 in frame 34]
  122. onClipEvent (enterFrame)
  123. {
  124.     if (_root.whoseGo == _root.PLAYER)
  125.     {
  126.     } // end if
  127. }
  128.  
  129. // [onClipEvent of sprite 158 in frame 189]
  130. onClipEvent (enterFrame)
  131. {
  132.     if (_root.whoseGo == _root.PLAYER)
  133.     {
  134.     } // end if
  135. }
  136.  
  137. // [onClipEvent of sprite 160 in frame 189]
  138. onClipEvent (enterFrame)
  139. {
  140.     if (_root.whoseGo == _root.PLAYER)
  141.     {
  142.     } // end if
  143. }
  144.  
  145. // [onClipEvent of sprite 158 in frame 191]
  146. onClipEvent (enterFrame)
  147. {
  148.     if (_root.whoseGo == _root.PLAYER)
  149.     {
  150.     } // end if
  151. }
  152.  
  153. // [onClipEvent of sprite 376 in frame 191]
  154. onClipEvent (enterFrame)
  155. {
  156.     if (_root.whoseGo == _root.PLAYER)
  157.     {
  158.     } // end if
  159. }
  160.  
  161. // [Action in Frame 2]
  162. sound_spawn = new Sound();
  163. sound_spawn.attachSound("sound_spawn");
  164. sound_spawn.setVolume(50);
  165. sound_take = new Sound();
  166. sound_take.attachSound("sound_take");
  167. sound_take.setVolume(50);
  168. sound_drums = new Sound();
  169. sound_drums.attachSound("sound_drums");
  170. muted = false;
  171.  
  172. stop ();
  173. redwins = 0;
  174. bluewins = 0;
  175. numGames = 0;
  176. sound_select = new Sound();
  177. sound_select.attachSound("sound_select");
  178. sound_select.setVolume(15);
  179. sound_pass = new Sound();
  180. sound_pass.attachSound("sound_pass");
  181. sound_end = new Sound();
  182. sound_end.attachSound("sound_end");
  183. sound_attack = new Sound();
  184. sound_attack.attachSound("sound_attack");
  185. sound_attack1 = new Sound();
  186. sound_attack1.attachSound("sound_attack1");
  187. sound_attack2 = new Sound();
  188. sound_attack2.attachSound("sound_attack2");
  189. sound_laugh = new Sound();
  190. sound_laugh.attachSound("sound_laugh");
  191. twoUpGame = false;
  192.  
  193. // [Action in Frame 3]
  194. stop ();
  195.  
  196. // [Action in Frame 4]
  197. stop ();
  198.  
  199. // [Action in Frame 5]
  200. stop ();
  201.  
  202. // [Action in Frame 6]
  203. stop ();
  204.  
  205. // [Action in Frame 7]
  206. stop ();
  207. name_txt.restrict = "a-z 0-9.:\\-@";
  208. Selection.setFocus(name_txt);
  209. Selection.setSelection(name_txt.length, name_txt.length);
  210. ok_btn.onRelease = function ()
  211. {
  212.     if (name_txt.length > 0)
  213.     {
  214.         _root.game_so.data.playerName = name_txt.text;
  215.     } // end if
  216.     Body = Body + "\n\nCheck out Blob Wars and other free games at www.kwikgames.com/blobwars.htm";
  217.     loadVariablesNum("http://www.kwikgames.com/cgi/flashemail.php", 0, "POST";
  218.     nextFrame ();
  219. };
  220. ok_btn.onKeyDown = function ()
  221. {
  222.     if (Key.getCode() == 13)
  223.     {
  224.         Key.removeListener(ok_btn);
  225.         this.onRelease();
  226.     } // end if
  227. };
  228. Key.addListener(ok_btn);
  229.  
  230. // [Action in Frame 8]
  231. stop ();
  232.  
  233. // [Action in Frame 33]
  234. trace ("first scene blink");
  235.  
  236. // [Action in Frame 34]
  237. function delay(length)
  238. {
  239.     x = getTimer();
  240.     do
  241.     {
  242.         y = getTimer();
  243.     } while (y < x + length)
  244. } // End of the function
  245. function computerGo()
  246. {
  247.     playersGo = false;
  248.     jumpMove = false;
  249.     canGo = false;
  250.     canGo2 = false;
  251.     highscore = 0;
  252.     highestscore = 0;
  253.     score = 0;
  254.     bestmove = n;
  255.     backupmove = 0;
  256.     highscore2 = 0;
  257.     highestscore2 = 0;
  258.     score2 = 0;
  259.     bestmove2 = n;
  260.     backupmove = 0;
  261.     direction = 0;
  262.     direction2 = 0;
  263.     canTake = false;
  264.     canTake2 = false;
  265.     compFull.length = 0;
  266.     compFull2.length = 0;
  267.     copyArrays();
  268.     for (i = 0; i < 100; i++)
  269.     {
  270.         if (compboard1[i] == 2)
  271.         {
  272.             backupmove = i;
  273.             canMove = false;
  274.             canMove2 = false;
  275.             trace ("comp at " + i);
  276.             if (compboard1[i + 1] == 1)
  277.             {
  278.                 canMove = true;
  279.                 j = i + 1;
  280.                 if (compboard1[j - 11] == 3)
  281.                 {
  282.                     ++score;
  283.                 } // end if
  284.                 if (compboard1[j - 10] == 3)
  285.                 {
  286.                     ++score;
  287.                 } // end if
  288.                 if (compboard1[j - 9] == 3)
  289.                 {
  290.                     ++score;
  291.                 } // end if
  292.                 if (compboard1[j - 1] == 3)
  293.                 {
  294.                     ++score;
  295.                 } // end if
  296.                 if (compboard1[j + 1] == 3)
  297.                 {
  298.                     ++score;
  299.                 } // end if
  300.                 if (compboard1[j + 11] == 3)
  301.                 {
  302.                     ++score;
  303.                 } // end if
  304.                 if (compboard1[j + 10] == 3)
  305.                 {
  306.                     ++score;
  307.                 } // end if
  308.                 if (compboard1[j + 9] == 3)
  309.                 {
  310.                     ++score;
  311.                 } // end if
  312.                 if (score > highscore)
  313.                 {
  314.                     highscore = score;
  315.                     if (highscore > highestscore)
  316.                     {
  317.                         highestscore = score;
  318.                         bestmove = i;
  319.                         bestblob = j;
  320.                         direction = 1;
  321.                         canTake = true;
  322.                     } // end if
  323.                 } // end if
  324.                 score = 0;
  325.             } // end if
  326.             if (compboard1[i - 1] == 1)
  327.             {
  328.                 canMove = true;
  329.                 j = i - 1;
  330.                 if (compboard1[j - 11] == 3)
  331.                 {
  332.                     ++score;
  333.                 } // end if
  334.                 if (compboard1[j - 10] == 3)
  335.                 {
  336.                     ++score;
  337.                 } // end if
  338.                 if (compboard1[j - 9] == 3)
  339.                 {
  340.                     ++score;
  341.                 } // end if
  342.                 if (compboard1[j - 1] == 3)
  343.                 {
  344.                     ++score;
  345.                 } // end if
  346.                 if (compboard1[j + 1] == 3)
  347.                 {
  348.                     ++score;
  349.                 } // end if
  350.                 if (compboard1[j + 11] == 3)
  351.                 {
  352.                     ++score;
  353.                 } // end if
  354.                 if (compboard1[j + 10] == 3)
  355.                 {
  356.                     ++score;
  357.                 } // end if
  358.                 if (compboard1[j + 9] == 3)
  359.                 {
  360.                     ++score;
  361.                 } // end if
  362.                 if (score > highscore)
  363.                 {
  364.                     highscore = score;
  365.                     if (highscore > highestscore)
  366.                     {
  367.                         highestscore = score;
  368.                         bestmove = i;
  369.                         bestblob = j;
  370.                         direction = -1;
  371.                         canTake = true;
  372.                     } // end if
  373.                 } // end if
  374.                 score = 0;
  375.             } // end if
  376.             if (compboard1[i + 9] == 1)
  377.             {
  378.                 canMove = true;
  379.                 j = i + 9;
  380.                 if (compboard1[j - 11] == 3)
  381.                 {
  382.                     ++score;
  383.                 } // end if
  384.                 if (compboard1[j - 10] == 3)
  385.                 {
  386.                     ++score;
  387.                 } // end if
  388.                 if (compboard1[j - 9] == 3)
  389.                 {
  390.                     ++score;
  391.                 } // end if
  392.                 if (compboard1[j - 1] == 3)
  393.                 {
  394.                     ++score;
  395.                 } // end if
  396.                 if (compboard1[j + 1] == 3)
  397.                 {
  398.                     ++score;
  399.                 } // end if
  400.                 if (compboard1[j + 11] == 3)
  401.                 {
  402.                     ++score;
  403.                 } // end if
  404.                 if (compboard1[j + 10] == 3)
  405.                 {
  406.                     ++score;
  407.                 } // end if
  408.                 if (compboard1[j + 9] == 3)
  409.                 {
  410.                     ++score;
  411.                 } // end if
  412.                 if (score > highscore)
  413.                 {
  414.                     highscore = score;
  415.                     if (highscore > highestscore)
  416.                     {
  417.                         highestscore = score;
  418.                         bestmove = i;
  419.                         bestblob = j;
  420.                         direction = 9;
  421.                         canTake = true;
  422.                     } // end if
  423.                 } // end if
  424.                 score = 0;
  425.             } // end if
  426.             if (compboard1[i + 10] == 1)
  427.             {
  428.                 canMove = true;
  429.                 j = i + 10;
  430.                 if (compboard1[j - 11] == 3)
  431.                 {
  432.                     ++score;
  433.                 } // end if
  434.                 if (compboard1[j - 10] == 3)
  435.                 {
  436.                     ++score;
  437.                 } // end if
  438.                 if (compboard1[j - 9] == 3)
  439.                 {
  440.                     ++score;
  441.                 } // end if
  442.                 if (compboard1[j - 1] == 3)
  443.                 {
  444.                     ++score;
  445.                 } // end if
  446.                 if (compboard1[j + 1] == 3)
  447.                 {
  448.                     ++score;
  449.                 } // end if
  450.                 if (compboard1[j + 11] == 3)
  451.                 {
  452.                     ++score;
  453.                 } // end if
  454.                 if (compboard1[j + 10] == 3)
  455.                 {
  456.                     ++score;
  457.                 } // end if
  458.                 if (compboard1[j + 9] == 3)
  459.                 {
  460.                     ++score;
  461.                 } // end if
  462.                 if (score > highscore)
  463.                 {
  464.                     highscore = score;
  465.                     if (highscore > highestscore)
  466.                     {
  467.                         highestscore = score;
  468.                         bestmove = i;
  469.                         bestblob = j;
  470.                         direction = 10;
  471.                         canTake = true;
  472.                     } // end if
  473.                 } // end if
  474.                 score = 0;
  475.             } // end if
  476.             if (compboard1[i + 11] == 1)
  477.             {
  478.                 canMove = true;
  479.                 j = i + 11;
  480.                 if (compboard1[j - 11] == 3)
  481.                 {
  482.                     ++score;
  483.                 } // end if
  484.                 if (compboard1[j - 10] == 3)
  485.                 {
  486.                     ++score;
  487.                 } // end if
  488.                 if (compboard1[j - 9] == 3)
  489.                 {
  490.                     ++score;
  491.                 } // end if
  492.                 if (compboard1[j - 1] == 3)
  493.                 {
  494.                     ++score;
  495.                 } // end if
  496.                 if (compboard1[j + 1] == 3)
  497.                 {
  498.                     ++score;
  499.                 } // end if
  500.                 if (compboard1[j + 11] == 3)
  501.                 {
  502.                     ++score;
  503.                 } // end if
  504.                 if (compboard1[j + 10] == 3)
  505.                 {
  506.                     ++score;
  507.                 } // end if
  508.                 if (compboard1[j + 9] == 3)
  509.                 {
  510.                     ++score;
  511.                 } // end if
  512.                 if (score > highscore)
  513.                 {
  514.                     highscore = score;
  515.                     if (highscore > highestscore)
  516.                     {
  517.                         highestscore = score;
  518.                         bestmove = i;
  519.                         bestblob = j;
  520.                         direction = 11;
  521.                         canTake = true;
  522.                     } // end if
  523.                 } // end if
  524.                 score = 0;
  525.             } // end if
  526.             if (compboard1[i - 9] == 1)
  527.             {
  528.                 canMove = true;
  529.                 j = i - 9;
  530.                 if (compboard1[j - 11] == 3)
  531.                 {
  532.                     ++score;
  533.                 } // end if
  534.                 if (compboard1[j - 10] == 3)
  535.                 {
  536.                     ++score;
  537.                 } // end if
  538.                 if (compboard1[j - 9] == 3)
  539.                 {
  540.                     ++score;
  541.                 } // end if
  542.                 if (compboard1[j - 1] == 3)
  543.                 {
  544.                     ++score;
  545.                 } // end if
  546.                 if (compboard1[j + 1] == 3)
  547.                 {
  548.                     ++score;
  549.                 } // end if
  550.                 if (compboard1[j + 11] == 3)
  551.                 {
  552.                     ++score;
  553.                 } // end if
  554.                 if (compboard1[j + 10] == 3)
  555.                 {
  556.                     ++score;
  557.                 } // end if
  558.                 if (compboard1[j + 9] == 3)
  559.                 {
  560.                     ++score;
  561.                 } // end if
  562.                 if (score > highscore)
  563.                 {
  564.                     highscore = score;
  565.                     if (highscore > highestscore)
  566.                     {
  567.                         highestscore = score;
  568.                         bestmove = i;
  569.                         bestblob = j;
  570.                         direction = -9;
  571.                         canTake = true;
  572.                     } // end if
  573.                 } // end if
  574.                 score = 0;
  575.             } // end if
  576.             if (compboard1[i - 10] == 1)
  577.             {
  578.                 canMove = true;
  579.                 j = i - 10;
  580.                 if (compboard1[j - 11] == 3)
  581.                 {
  582.                     ++score;
  583.                 } // end if
  584.                 if (compboard1[j - 10] == 3)
  585.                 {
  586.                     ++score;
  587.                 } // end if
  588.                 if (compboard1[j - 9] == 3)
  589.                 {
  590.                     ++score;
  591.                 } // end if
  592.                 if (compboard1[j - 1] == 3)
  593.                 {
  594.                     ++score;
  595.                 } // end if
  596.                 if (compboard1[j + 1] == 3)
  597.                 {
  598.                     ++score;
  599.                 } // end if
  600.                 if (compboard1[j + 11] == 3)
  601.                 {
  602.                     ++score;
  603.                 } // end if
  604.                 if (compboard1[j + 10] == 3)
  605.                 {
  606.                     ++score;
  607.                 } // end if
  608.                 if (compboard1[j + 9] == 3)
  609.                 {
  610.                     ++score;
  611.                 } // end if
  612.                 if (score > highscore)
  613.                 {
  614.                     highscore = score;
  615.                     if (highscore > highestscore)
  616.                     {
  617.                         highestscore = score;
  618.                         bestmove = i;
  619.                         bestblob = j;
  620.                         direction = -10;
  621.                         canTake = true;
  622.                     } // end if
  623.                 } // end if
  624.                 score = 0;
  625.             } // end if
  626.             if (compboard1[i - 11] == 1)
  627.             {
  628.                 canMove = true;
  629.                 j = i - 11;
  630.                 if (compboard1[j - 11] == 3)
  631.                 {
  632.                     ++score;
  633.                 } // end if
  634.                 if (compboard1[j - 10] == 3)
  635.                 {
  636.                     ++score;
  637.                 } // end if
  638.                 if (compboard1[j - 9] == 3)
  639.                 {
  640.                     ++score;
  641.                 } // end if
  642.                 if (compboard1[j - 1] == 3)
  643.                 {
  644.                     ++score;
  645.                 } // end if
  646.                 if (compboard1[j + 1] == 3)
  647.                 {
  648.                     ++score;
  649.                 } // end if
  650.                 if (compboard1[j + 11] == 3)
  651.                 {
  652.                     ++score;
  653.                 } // end if
  654.                 if (compboard1[j + 10] == 3)
  655.                 {
  656.                     ++score;
  657.                 } // end if
  658.                 if (compboard1[j + 9] == 3)
  659.                 {
  660.                     ++score;
  661.                 } // end if
  662.                 if (score > highscore)
  663.                 {
  664.                     highscore = score;
  665.                     if (highscore > highestscore)
  666.                     {
  667.                         highestscore = score;
  668.                         bestmove = i;
  669.                         bestblob = j;
  670.                         direction = -11;
  671.                         canTake = true;
  672.                     } // end if
  673.                 } // end if
  674.                 score = 0;
  675.             } // end if
  676.             if (compboard1[i + 2] == 1)
  677.             {
  678.                 canMove2 = true;
  679.                 j = i + 2;
  680.                 if (compboard1[j - 11] == 3)
  681.                 {
  682.                     ++score;
  683.                 } // end if
  684.                 if (compboard1[j - 10] == 3)
  685.                 {
  686.                     ++score;
  687.                 } // end if
  688.                 if (compboard1[j - 9] == 3)
  689.                 {
  690.                     ++score;
  691.                 } // end if
  692.                 if (compboard1[j - 1] == 3)
  693.                 {
  694.                     ++score;
  695.                 } // end if
  696.                 if (compboard1[j + 1] == 3)
  697.                 {
  698.                     ++score;
  699.                 } // end if
  700.                 if (compboard1[j + 11] == 3)
  701.                 {
  702.                     ++score;
  703.                 } // end if
  704.                 if (compboard1[j + 10] == 3)
  705.                 {
  706.                     ++score;
  707.                 } // end if
  708.                 if (compboard1[j + 9] == 3)
  709.                 {
  710.                     ++score;
  711.                 } // end if
  712.                 if (score > highscore2)
  713.                 {
  714.                     highscore2 = score;
  715.                     if (highscore2 > highestscore2)
  716.                     {
  717.                         highestscore2 = score;
  718.                         bestmove2 = i;
  719.                         bestblob2 = j;
  720.                         direction2 = 2;
  721.                         canTake2 = true;
  722.                     } // end if
  723.                 } // end if
  724.                 score = 0;
  725.             } // end if
  726.             if (compboard1[i - 2] == 1)
  727.             {
  728.                 canMove2 = true;
  729.                 j = i - 2;
  730.                 if (compboard1[j - 11] == 3)
  731.                 {
  732.                     ++score;
  733.                 } // end if
  734.                 if (compboard1[j - 10] == 3)
  735.                 {
  736.                     ++score;
  737.                 } // end if
  738.                 if (compboard1[j - 9] == 3)
  739.                 {
  740.                     ++score;
  741.                 } // end if
  742.                 if (compboard1[j - 1] == 3)
  743.                 {
  744.                     ++score;
  745.                 } // end if
  746.                 if (compboard1[j + 1] == 3)
  747.                 {
  748.                     ++score;
  749.                 } // end if
  750.                 if (compboard1[j + 11] == 3)
  751.                 {
  752.                     ++score;
  753.                 } // end if
  754.                 if (compboard1[j + 10] == 3)
  755.                 {
  756.                     ++score;
  757.                 } // end if
  758.                 if (compboard1[j + 9] == 3)
  759.                 {
  760.                     ++score;
  761.                 } // end if
  762.                 if (score > highscore2)
  763.                 {
  764.                     highscore2 = score;
  765.                     if (highscore2 > highestscore2)
  766.                     {
  767.                         highestscore2 = score;
  768.                         bestmove2 = i;
  769.                         bestblob2 = j;
  770.                         direction2 = -2;
  771.                         canTake2 = true;
  772.                     } // end if
  773.                 } // end if
  774.                 score = 0;
  775.             } // end if
  776.             if (compboard1[i + 8] == 1)
  777.             {
  778.                 canMove2 = true;
  779.                 j = i + 8;
  780.                 if (compboard1[j - 11] == 3)
  781.                 {
  782.                     ++score;
  783.                 } // end if
  784.                 if (compboard1[j - 10] == 3)
  785.                 {
  786.                     ++score;
  787.                 } // end if
  788.                 if (compboard1[j - 9] == 3)
  789.                 {
  790.                     ++score;
  791.                 } // end if
  792.                 if (compboard1[j - 1] == 3)
  793.                 {
  794.                     ++score;
  795.                 } // end if
  796.                 if (compboard1[j + 1] == 3)
  797.                 {
  798.                     ++score;
  799.                 } // end if
  800.                 if (compboard1[j + 11] == 3)
  801.                 {
  802.                     ++score;
  803.                 } // end if
  804.                 if (compboard1[j + 10] == 3)
  805.                 {
  806.                     ++score;
  807.                 } // end if
  808.                 if (compboard1[j + 9] == 3)
  809.                 {
  810.                     ++score;
  811.                 } // end if
  812.                 if (score > highscore2)
  813.                 {
  814.                     highscore2 = score;
  815.                     if (highscore2 > highestscore2)
  816.                     {
  817.                         highestscore2 = score;
  818.                         bestmove2 = i;
  819.                         bestblob2 = j;
  820.                         direction2 = 8;
  821.                         canTake2 = true;
  822.                     } // end if
  823.                 } // end if
  824.                 score = 0;
  825.             } // end if
  826.             if (compboard1[i + 10] == 1)
  827.             {
  828.                 canMove2 = true;
  829.                 j = i + 10;
  830.                 if (compboard1[j - 11] == 3)
  831.                 {
  832.                     ++score;
  833.                 } // end if
  834.                 if (compboard1[j - 10] == 3)
  835.                 {
  836.                     ++score;
  837.                 } // end if
  838.                 if (compboard1[j - 9] == 3)
  839.                 {
  840.                     ++score;
  841.                 } // end if
  842.                 if (compboard1[j - 1] == 3)
  843.                 {
  844.                     ++score;
  845.                 } // end if
  846.                 if (compboard1[j + 1] == 3)
  847.                 {
  848.                     ++score;
  849.                 } // end if
  850.                 if (compboard1[j + 11] == 3)
  851.                 {
  852.                     ++score;
  853.                 } // end if
  854.                 if (compboard1[j + 10] == 3)
  855.                 {
  856.                     ++score;
  857.                 } // end if
  858.                 if (compboard1[j + 9] == 3)
  859.                 {
  860.                     ++score;
  861.                 } // end if
  862.                 if (score > highscore2)
  863.                 {
  864.                     highscore2 = score;
  865.                     if (highscore2 > highestscore2)
  866.                     {
  867.                         highestscore2 = score;
  868.                         bestmove2 = i;
  869.                         bestblob2 = j;
  870.                         direction2 = 10;
  871.                         canTake2 = true;
  872.                     } // end if
  873.                 } // end if
  874.                 score = 0;
  875.             } // end if
  876.             if (compboard1[i + 12] == 1)
  877.             {
  878.                 canMove2 = true;
  879.                 j = i + 12;
  880.                 if (compboard1[j - 11] == 3)
  881.                 {
  882.                     ++score;
  883.                 } // end if
  884.                 if (compboard1[j - 10] == 3)
  885.                 {
  886.                     ++score;
  887.                 } // end if
  888.                 if (compboard1[j - 9] == 3)
  889.                 {
  890.                     ++score;
  891.                 } // end if
  892.                 if (compboard1[j - 1] == 3)
  893.                 {
  894.                     ++score;
  895.                 } // end if
  896.                 if (compboard1[j + 1] == 3)
  897.                 {
  898.                     ++score;
  899.                 } // end if
  900.                 if (compboard1[j + 11] == 3)
  901.                 {
  902.                     ++score;
  903.                 } // end if
  904.                 if (compboard1[j + 10] == 3)
  905.                 {
  906.                     ++score;
  907.                 } // end if
  908.                 if (compboard1[j + 9] == 3)
  909.                 {
  910.                     ++score;
  911.                 } // end if
  912.                 if (score > highscore2)
  913.                 {
  914.                     highscore2 = score;
  915.                     if (highscore2 > highestscore2)
  916.                     {
  917.                         highestscore2 = score;
  918.                         bestmove2 = i;
  919.                         bestblob2 = j;
  920.                         direction2 = 12;
  921.                         canTake2 = true;
  922.                     } // end if
  923.                 } // end if
  924.                 score = 0;
  925.             } // end if
  926.             if (compboard1[i + 18] == 1)
  927.             {
  928.                 canMove2 = true;
  929.                 j = i + 18;
  930.                 if (compboard1[j - 11] == 3)
  931.                 {
  932.                     ++score;
  933.                 } // end if
  934.                 if (compboard1[j - 10] == 3)
  935.                 {
  936.                     ++score;
  937.                 } // end if
  938.                 if (compboard1[j - 9] == 3)
  939.                 {
  940.                     ++score;
  941.                 } // end if
  942.                 if (compboard1[j - 1] == 3)
  943.                 {
  944.                     ++score;
  945.                 } // end if
  946.                 if (compboard1[j + 1] == 3)
  947.                 {
  948.                     ++score;
  949.                 } // end if
  950.                 if (compboard1[j + 11] == 3)
  951.                 {
  952.                     ++score;
  953.                 } // end if
  954.                 if (compboard1[j + 10] == 3)
  955.                 {
  956.                     ++score;
  957.                 } // end if
  958.                 if (compboard1[j + 9] == 3)
  959.                 {
  960.                     ++score;
  961.                 } // end if
  962.                 if (score > highscore2)
  963.                 {
  964.                     highscore2 = score;
  965.                     if (highscore2 > highestscore2)
  966.                     {
  967.                         highestscore2 = score;
  968.                         bestmove2 = i;
  969.                         bestblob2 = j;
  970.                         direction2 = 18;
  971.                         canTake2 = true;
  972.                     } // end if
  973.                 } // end if
  974.                 score = 0;
  975.             } // end if
  976.             if (compboard1[i + 19] == 1)
  977.             {
  978.                 canMove2 = true;
  979.                 j = i + 19;
  980.                 if (compboard1[j - 11] == 3)
  981.                 {
  982.                     ++score;
  983.                 } // end if
  984.                 if (compboard1[j - 10] == 3)
  985.                 {
  986.                     ++score;
  987.                 } // end if
  988.                 if (compboard1[j - 9] == 3)
  989.                 {
  990.                     ++score;
  991.                 } // end if
  992.                 if (compboard1[j - 1] == 3)
  993.                 {
  994.                     ++score;
  995.                 } // end if
  996.                 if (compboard1[j + 1] == 3)
  997.                 {
  998.                     ++score;
  999.                 } // end if
  1000.                 if (compboard1[j + 11] == 3)
  1001.                 {
  1002.                     ++score;
  1003.                 } // end if
  1004.                 if (compboard1[j + 10] == 3)
  1005.                 {
  1006.                     ++score;
  1007.                 } // end if
  1008.                 if (compboard1[j + 9] == 3)
  1009.                 {
  1010.                     ++score;
  1011.                 } // end if
  1012.                 if (score > highscore2)
  1013.                 {
  1014.                     highscore2 = score;
  1015.                     if (highscore2 > highestscore2)
  1016.                     {
  1017.                         highestscore2 = score;
  1018.                         bestmove2 = i;
  1019.                         bestblob2 = j;
  1020.                         direction2 = 19;
  1021.                         canTake2 = true;
  1022.                     } // end if
  1023.                 } // end if
  1024.                 score = 0;
  1025.             } // end if
  1026.             if (compboard1[i + 20] == 1)
  1027.             {
  1028.                 canMove2 = true;
  1029.                 j = i + 20;
  1030.                 if (compboard1[j - 11] == 3)
  1031.                 {
  1032.                     ++score;
  1033.                 } // end if
  1034.                 if (compboard1[j - 10] == 3)
  1035.                 {
  1036.                     ++score;
  1037.                 } // end if
  1038.                 if (compboard1[j - 9] == 3)
  1039.                 {
  1040.                     ++score;
  1041.                 } // end if
  1042.                 if (compboard1[j - 1] == 3)
  1043.                 {
  1044.                     ++score;
  1045.                 } // end if
  1046.                 if (compboard1[j + 1] == 3)
  1047.                 {
  1048.                     ++score;
  1049.                 } // end if
  1050.                 if (compboard1[j + 11] == 3)
  1051.                 {
  1052.                     ++score;
  1053.                 } // end if
  1054.                 if (compboard1[j + 10] == 3)
  1055.                 {
  1056.                     ++score;
  1057.                 } // end if
  1058.                 if (compboard1[j + 9] == 3)
  1059.                 {
  1060.                     ++score;
  1061.                 } // end if
  1062.                 if (score > highscore2)
  1063.                 {
  1064.                     highscore2 = score;
  1065.                     if (highscore2 > highestscore2)
  1066.                     {
  1067.                         highestscore2 = score;
  1068.                         bestmove2 = i;
  1069.                         bestblob2 = j;
  1070.                         direction2 = 20;
  1071.                         canTake2 = true;
  1072.                     } // end if
  1073.                 } // end if
  1074.                 score = 0;
  1075.             } // end if
  1076.             if (compboard1[i + 21] == 1)
  1077.             {
  1078.                 canMove2 = true;
  1079.                 j = i + 21;
  1080.                 if (compboard1[j - 11] == 3)
  1081.                 {
  1082.                     ++score;
  1083.                 } // end if
  1084.                 if (compboard1[j - 10] == 3)
  1085.                 {
  1086.                     ++score;
  1087.                 } // end if
  1088.                 if (compboard1[j - 9] == 3)
  1089.                 {
  1090.                     ++score;
  1091.                 } // end if
  1092.                 if (compboard1[j - 1] == 3)
  1093.                 {
  1094.                     ++score;
  1095.                 } // end if
  1096.                 if (compboard1[j + 1] == 3)
  1097.                 {
  1098.                     ++score;
  1099.                 } // end if
  1100.                 if (compboard1[j + 11] == 3)
  1101.                 {
  1102.                     ++score;
  1103.                 } // end if
  1104.                 if (compboard1[j + 10] == 3)
  1105.                 {
  1106.                     ++score;
  1107.                 } // end if
  1108.                 if (compboard1[j + 9] == 3)
  1109.                 {
  1110.                     ++score;
  1111.                 } // end if
  1112.                 if (score > highscore2)
  1113.                 {
  1114.                     highscore2 = score;
  1115.                     if (highscore2 > highestscore2)
  1116.                     {
  1117.                         highestscore2 = score;
  1118.                         bestmove2 = i;
  1119.                         bestblob2 = j;
  1120.                         direction2 = 21;
  1121.                         canTake2 = true;
  1122.                     } // end if
  1123.                 } // end if
  1124.                 score = 0;
  1125.             } // end if
  1126.             if (compboard1[i + 22] == 1)
  1127.             {
  1128.                 canMove2 = true;
  1129.                 j = i + 22;
  1130.                 if (compboard1[j - 11] == 3)
  1131.                 {
  1132.                     ++score;
  1133.                 } // end if
  1134.                 if (compboard1[j - 10] == 3)
  1135.                 {
  1136.                     ++score;
  1137.                 } // end if
  1138.                 if (compboard1[j - 9] == 3)
  1139.                 {
  1140.                     ++score;
  1141.                 } // end if
  1142.                 if (compboard1[j - 1] == 3)
  1143.                 {
  1144.                     ++score;
  1145.                 } // end if
  1146.                 if (compboard1[j + 1] == 3)
  1147.                 {
  1148.                     ++score;
  1149.                 } // end if
  1150.                 if (compboard1[j + 11] == 3)
  1151.                 {
  1152.                     ++score;
  1153.                 } // end if
  1154.                 if (compboard1[j + 10] == 3)
  1155.                 {
  1156.                     ++score;
  1157.                 } // end if
  1158.                 if (compboard1[j + 9] == 3)
  1159.                 {
  1160.                     ++score;
  1161.                 } // end if
  1162.                 if (score > highscore2)
  1163.                 {
  1164.                     highscore2 = score;
  1165.                     if (highscore2 > highestscore2)
  1166.                     {
  1167.                         highestscore2 = score;
  1168.                         bestmove2 = i;
  1169.                         bestblob2 = j;
  1170.                         direction2 = 22;
  1171.                         canTake2 = true;
  1172.                     } // end if
  1173.                 } // end if
  1174.                 score = 0;
  1175.             } // end if
  1176.             if (compboard1[i - 8] == 1)
  1177.             {
  1178.                 canMove2 = true;
  1179.                 j = i - 8;
  1180.                 if (compboard1[j - 11] == 3)
  1181.                 {
  1182.                     ++score;
  1183.                 } // end if
  1184.                 if (compboard1[j - 10] == 3)
  1185.                 {
  1186.                     ++score;
  1187.                 } // end if
  1188.                 if (compboard1[j - 9] == 3)
  1189.                 {
  1190.                     ++score;
  1191.                 } // end if
  1192.                 if (compboard1[j - 1] == 3)
  1193.                 {
  1194.                     ++score;
  1195.                 } // end if
  1196.                 if (compboard1[j + 1] == 3)
  1197.                 {
  1198.                     ++score;
  1199.                 } // end if
  1200.                 if (compboard1[j + 11] == 3)
  1201.                 {
  1202.                     ++score;
  1203.                 } // end if
  1204.                 if (compboard1[j + 10] == 3)
  1205.                 {
  1206.                     ++score;
  1207.                 } // end if
  1208.                 if (compboard1[j + 9] == 3)
  1209.                 {
  1210.                     ++score;
  1211.                 } // end if
  1212.                 if (score > highscore2)
  1213.                 {
  1214.                     highscore2 = score;
  1215.                     if (highscore2 > highestscore2)
  1216.                     {
  1217.                         highestscore2 = score;
  1218.                         bestmove2 = i;
  1219.                         bestblob2 = j;
  1220.                         direction2 = -8;
  1221.                         canTake2 = true;
  1222.                     } // end if
  1223.                 } // end if
  1224.                 score = 0;
  1225.             } // end if
  1226.             if (compboard1[i - 10] == 1)
  1227.             {
  1228.                 canMove2 = true;
  1229.                 j = i - 10;
  1230.                 if (compboard1[j - 11] == 3)
  1231.                 {
  1232.                     ++score;
  1233.                 } // end if
  1234.                 if (compboard1[j - 10] == 3)
  1235.                 {
  1236.                     ++score;
  1237.                 } // end if
  1238.                 if (compboard1[j - 9] == 3)
  1239.                 {
  1240.                     ++score;
  1241.                 } // end if
  1242.                 if (compboard1[j - 1] == 3)
  1243.                 {
  1244.                     ++score;
  1245.                 } // end if
  1246.                 if (compboard1[j + 1] == 3)
  1247.                 {
  1248.                     ++score;
  1249.                 } // end if
  1250.                 if (compboard1[j + 11] == 3)
  1251.                 {
  1252.                     ++score;
  1253.                 } // end if
  1254.                 if (compboard1[j + 10] == 3)
  1255.                 {
  1256.                     ++score;
  1257.                 } // end if
  1258.                 if (compboard1[j + 9] == 3)
  1259.                 {
  1260.                     ++score;
  1261.                 } // end if
  1262.                 if (score > highscore2)
  1263.                 {
  1264.                     highscore2 = score;
  1265.                     if (highscore2 > highestscore2)
  1266.                     {
  1267.                         highestscore2 = score;
  1268.                         bestmove2 = i;
  1269.                         bestblob2 = j;
  1270.                         direction2 = -10;
  1271.                         canTake2 = true;
  1272.                     } // end if
  1273.                 } // end if
  1274.                 score = 0;
  1275.             } // end if
  1276.             if (compboard1[i - 12] == 1)
  1277.             {
  1278.                 canMove2 = true;
  1279.                 j = i - 12;
  1280.                 if (compboard1[j - 11] == 3)
  1281.                 {
  1282.                     ++score;
  1283.                 } // end if
  1284.                 if (compboard1[j - 10] == 3)
  1285.                 {
  1286.                     ++score;
  1287.                 } // end if
  1288.                 if (compboard1[j - 9] == 3)
  1289.                 {
  1290.                     ++score;
  1291.                 } // end if
  1292.                 if (compboard1[j - 1] == 3)
  1293.                 {
  1294.                     ++score;
  1295.                 } // end if
  1296.                 if (compboard1[j + 1] == 3)
  1297.                 {
  1298.                     ++score;
  1299.                 } // end if
  1300.                 if (compboard1[j + 11] == 3)
  1301.                 {
  1302.                     ++score;
  1303.                 } // end if
  1304.                 if (compboard1[j + 10] == 3)
  1305.                 {
  1306.                     ++score;
  1307.                 } // end if
  1308.                 if (compboard1[j + 9] == 3)
  1309.                 {
  1310.                     ++score;
  1311.                 } // end if
  1312.                 if (score > highscore2)
  1313.                 {
  1314.                     highscore2 = score;
  1315.                     if (highscore2 > highestscore2)
  1316.                     {
  1317.                         highestscore2 = score;
  1318.                         bestmove2 = i;
  1319.                         bestblob2 = j;
  1320.                         direction2 = -12;
  1321.                         canTake2 = true;
  1322.                     } // end if
  1323.                 } // end if
  1324.                 score = 0;
  1325.             } // end if
  1326.             if (compboard1[i - 18] == 1)
  1327.             {
  1328.                 canMove2 = true;
  1329.                 j = i - 18;
  1330.                 if (compboard1[j - 11] == 3)
  1331.                 {
  1332.                     ++score;
  1333.                 } // end if
  1334.                 if (compboard1[j - 10] == 3)
  1335.                 {
  1336.                     ++score;
  1337.                 } // end if
  1338.                 if (compboard1[j - 9] == 3)
  1339.                 {
  1340.                     ++score;
  1341.                 } // end if
  1342.                 if (compboard1[j - 1] == 3)
  1343.                 {
  1344.                     ++score;
  1345.                 } // end if
  1346.                 if (compboard1[j + 1] == 3)
  1347.                 {
  1348.                     ++score;
  1349.                 } // end if
  1350.                 if (compboard1[j + 11] == 3)
  1351.                 {
  1352.                     ++score;
  1353.                 } // end if
  1354.                 if (compboard1[j + 10] == 3)
  1355.                 {
  1356.                     ++score;
  1357.                 } // end if
  1358.                 if (compboard1[j + 9] == 3)
  1359.                 {
  1360.                     ++score;
  1361.                 } // end if
  1362.                 if (score > highscore2)
  1363.                 {
  1364.                     highscore2 = score;
  1365.                     if (highscore2 > highestscore2)
  1366.                     {
  1367.                         highestscore2 = score;
  1368.                         bestmove2 = i;
  1369.                         bestblob2 = j;
  1370.                         direction2 = -18;
  1371.                         canTake2 = true;
  1372.                     } // end if
  1373.                 } // end if
  1374.                 score = 0;
  1375.             } // end if
  1376.             if (compboard1[i - 19] == 1)
  1377.             {
  1378.                 canMove2 = true;
  1379.                 j = i - 19;
  1380.                 if (compboard1[j - 11] == 3)
  1381.                 {
  1382.                     ++score;
  1383.                 } // end if
  1384.                 if (compboard1[j - 10] == 3)
  1385.                 {
  1386.                     ++score;
  1387.                 } // end if
  1388.                 if (compboard1[j - 9] == 3)
  1389.                 {
  1390.                     ++score;
  1391.                 } // end if
  1392.                 if (compboard1[j - 1] == 3)
  1393.                 {
  1394.                     ++score;
  1395.                 } // end if
  1396.                 if (compboard1[j + 1] == 3)
  1397.                 {
  1398.                     ++score;
  1399.                 } // end if
  1400.                 if (compboard1[j + 11] == 3)
  1401.                 {
  1402.                     ++score;
  1403.                 } // end if
  1404.                 if (compboard1[j + 10] == 3)
  1405.                 {
  1406.                     ++score;
  1407.                 } // end if
  1408.                 if (compboard1[j + 9] == 3)
  1409.                 {
  1410.                     ++score;
  1411.                 } // end if
  1412.                 if (score > highscore2)
  1413.                 {
  1414.                     highscore2 = score;
  1415.                     if (highscore2 > highestscore2)
  1416.                     {
  1417.                         highestscore2 = score;
  1418.                         bestmove2 = i;
  1419.                         bestblob2 = j;
  1420.                         direction2 = -19;
  1421.                         canTake2 = true;
  1422.                     } // end if
  1423.                 } // end if
  1424.                 score = 0;
  1425.             } // end if
  1426.             if (compboard1[i - 20] == 1)
  1427.             {
  1428.                 canMove2 = true;
  1429.                 j = i - 20;
  1430.                 if (compboard1[j - 11] == 3)
  1431.                 {
  1432.                     ++score;
  1433.                 } // end if
  1434.                 if (compboard1[j - 10] == 3)
  1435.                 {
  1436.                     ++score;
  1437.                 } // end if
  1438.                 if (compboard1[j - 9] == 3)
  1439.                 {
  1440.                     ++score;
  1441.                 } // end if
  1442.                 if (compboard1[j - 1] == 3)
  1443.                 {
  1444.                     ++score;
  1445.                 } // end if
  1446.                 if (compboard1[j + 1] == 3)
  1447.                 {
  1448.                     ++score;
  1449.                 } // end if
  1450.                 if (compboard1[j + 11] == 3)
  1451.                 {
  1452.                     ++score;
  1453.                 } // end if
  1454.                 if (compboard1[j + 10] == 3)
  1455.                 {
  1456.                     ++score;
  1457.                 } // end if
  1458.                 if (compboard1[j + 9] == 3)
  1459.                 {
  1460.                     ++score;
  1461.                 } // end if
  1462.                 if (score > highscore2)
  1463.                 {
  1464.                     highscore2 = score;
  1465.                     if (highscore2 > highestscore2)
  1466.                     {
  1467.                         highestscore2 = score;
  1468.                         bestmove2 = i;
  1469.                         bestblob2 = j;
  1470.                         direction2 = -20;
  1471.                         canTake2 = true;
  1472.                     } // end if
  1473.                 } // end if
  1474.                 score = 0;
  1475.             } // end if
  1476.             if (compboard1[i - 21] == 1)
  1477.             {
  1478.                 canMove2 = true;
  1479.                 j = i - 21;
  1480.                 if (compboard1[j - 11] == 3)
  1481.                 {
  1482.                     ++score;
  1483.                 } // end if
  1484.                 if (compboard1[j - 10] == 3)
  1485.                 {
  1486.                     ++score;
  1487.                 } // end if
  1488.                 if (compboard1[j - 9] == 3)
  1489.                 {
  1490.                     ++score;
  1491.                 } // end if
  1492.                 if (compboard1[j - 1] == 3)
  1493.                 {
  1494.                     ++score;
  1495.                 } // end if
  1496.                 if (compboard1[j + 1] == 3)
  1497.                 {
  1498.                     ++score;
  1499.                 } // end if
  1500.                 if (compboard1[j + 11] == 3)
  1501.                 {
  1502.                     ++score;
  1503.                 } // end if
  1504.                 if (compboard1[j + 10] == 3)
  1505.                 {
  1506.                     ++score;
  1507.                 } // end if
  1508.                 if (compboard1[j + 9] == 3)
  1509.                 {
  1510.                     ++score;
  1511.                 } // end if
  1512.                 if (score > highscore2)
  1513.                 {
  1514.                     highscore2 = score;
  1515.                     if (highscore2 > highestscore2)
  1516.                     {
  1517.                         highestscore2 = score;
  1518.                         bestmove2 = i;
  1519.                         bestblob2 = j;
  1520.                         direction2 = -21;
  1521.                         canTake2 = true;
  1522.                     } // end if
  1523.                 } // end if
  1524.                 score = 0;
  1525.             } // end if
  1526.             if (compboard1[i - 22] == 1)
  1527.             {
  1528.                 canMove2 = true;
  1529.                 j = i - 22;
  1530.                 if (compboard1[j - 11] == 3)
  1531.                 {
  1532.                     ++score;
  1533.                 } // end if
  1534.                 if (compboard1[j - 10] == 3)
  1535.                 {
  1536.                     ++score;
  1537.                 } // end if
  1538.                 if (compboard1[j - 9] == 3)
  1539.                 {
  1540.                     ++score;
  1541.                 } // end if
  1542.                 if (compboard1[j - 1] == 3)
  1543.                 {
  1544.                     ++score;
  1545.                 } // end if
  1546.                 if (compboard1[j + 1] == 3)
  1547.                 {
  1548.                     ++score;
  1549.                 } // end if
  1550.                 if (compboard1[j + 11] == 3)
  1551.                 {
  1552.                     ++score;
  1553.                 } // end if
  1554.                 if (compboard1[j + 10] == 3)
  1555.                 {
  1556.                     ++score;
  1557.                 } // end if
  1558.                 if (compboard1[j + 9] == 3)
  1559.                 {
  1560.                     ++score;
  1561.                 } // end if
  1562.                 if (score > highscore2)
  1563.                 {
  1564.                     highscore2 = score;
  1565.                     if (highscore2 > highestscore2)
  1566.                     {
  1567.                         highestscore2 = score;
  1568.                         bestmove2 = i;
  1569.                         bestblob2 = j;
  1570.                         direction2 = -22;
  1571.                         canTake2 = true;
  1572.                     } // end if
  1573.                 } // end if
  1574.                 score = 0;
  1575.             } // end if
  1576.             if (canMove)
  1577.             {
  1578.                 compFull.push(i);
  1579.                 canGo = true;
  1580.             } // end if
  1581.             if (canMove2)
  1582.             {
  1583.                 compFull2.push(i);
  1584.                 canGo2 = true;
  1585.             } // end if
  1586.             compboard2[i] = highscore;
  1587.             compboard3[i] = highscore2;
  1588.             trace (highscore);
  1589.             trace ("jump " + highscore2);
  1590.             trace (compboard3);
  1591.             trace ("jump moves" + compFull2);
  1592.             highscore = 0;
  1593.             highscore2 = 0;
  1594.         } // end if
  1595.     } // end of for
  1596.     if (highestscore == 0)
  1597.     {
  1598.         bestmove = backupmove;
  1599.         trace ("backup move");
  1600.     } // end if
  1601.     trace ("best move : " + bestmove + " score : " + highestscore + " direction : " + direction);
  1602.     trace ("bestJmove : " + bestmove2 + " score : " + highestscore2 + " direction : " + direction2);
  1603.     debugShowBoard();
  1604.     bestblob = bestmove;
  1605.     bestmove = bestmove + direction;
  1606.     bestmove = compensateArrays(bestmove);
  1607.     bestblob = compensateArrays(bestblob);
  1608.     bestblob2 = bestmove2;
  1609.     bestmove2 = bestmove2 + direction2;
  1610.     bestmove2 = compensateArrays(bestmove2);
  1611.     bestblob2 = compensateArrays(bestblob2);
  1612.     if (canTake2 == true && highestscore2 > highestscore)
  1613.     {
  1614.         if (blues == 2)
  1615.         {
  1616.             canGo = flase;
  1617.         }
  1618.         else if (blues < 5)
  1619.         {
  1620.             newRandom = myRandom(0, 4);
  1621.             if (newRandom < 2)
  1622.             {
  1623.                 canGo = false;
  1624.             } // end if
  1625.         }
  1626.         else if (highestscore2 == 8)
  1627.         {
  1628.             canGo = false;
  1629.         }
  1630.         else if (highestscore2 < highestscore + 6)
  1631.         {
  1632.             newRandom = myRandom(0, 5);
  1633.             if (newRandom < 2)
  1634.             {
  1635.                 canGo = false;
  1636.             } // end if
  1637.         }
  1638.         else if (highestscore2 < highestscore + 5)
  1639.         {
  1640.             newRandom = myRandom(0, 6);
  1641.             if (newRandom < 2)
  1642.             {
  1643.                 canGo = false;
  1644.             } // end if
  1645.         }
  1646.         else if (highestscore2 < highestscore + 3)
  1647.         {
  1648.             newRandom = myRandom(0, 6);
  1649.             if (newRandom < 1)
  1650.             {
  1651.                 canGo = false;
  1652.             } // end if
  1653.         }
  1654.         else
  1655.         {
  1656.             newRandom = myRandom(0, 12);
  1657.             if (newRandom < 1)
  1658.             {
  1659.                 canGo = false;
  1660.             } // end else if
  1661.         } // end else if
  1662.     } // end else if
  1663.     if (canGo)
  1664.     {
  1665.         if (canTake)
  1666.         {
  1667.             gameboard[bestblob] = 46;
  1668.             computerClicked(name, bestblob);
  1669.             gameboard[bestblob] = 2;
  1670.             computerGoDelay.play();
  1671.         }
  1672.         else
  1673.         {
  1674.             pos = compFull.length - 1;
  1675.             newRandom = myRandom(0, pos);
  1676.             j = compFull[newRandom];
  1677.             trace ("Move blob : " + j + " | " + pos + " | " + newRandom);
  1678.             bestblob = compensateArrays(j);
  1679.             compFull.length = 0;
  1680.             if (compboard1[j - 11] == 1)
  1681.             {
  1682.                 compFull.push(j - 11);
  1683.             } // end if
  1684.             if (compboard1[j - 10] == 1)
  1685.             {
  1686.                 compFull.push(j - 10);
  1687.             } // end if
  1688.             if (compboard1[j - 9] == 1)
  1689.             {
  1690.                 compFull.push(j - 9);
  1691.             } // end if
  1692.             if (compboard1[j - 1] == 1)
  1693.             {
  1694.                 compFull.push(j - 1);
  1695.             } // end if
  1696.             if (compboard1[j + 1] == 1)
  1697.             {
  1698.                 compFull.push(j + 1);
  1699.             } // end if
  1700.             if (compboard1[j + 11] == 1)
  1701.             {
  1702.                 compFull.push(j + 11);
  1703.             } // end if
  1704.             if (compboard1[j + 10] == 1)
  1705.             {
  1706.                 compFull.push(j + 10);
  1707.             } // end if
  1708.             if (compboard1[j + 9] == 1)
  1709.             {
  1710.                 compFull.push(j + 9);
  1711.             } // end if
  1712.             pos = compFull.length - 1;
  1713.             bestmove = myRandom(0, pos);
  1714.             bestmove = compFull[bestmove];
  1715.             trace (bestmove + " | " + compFull);
  1716.             bestmove = compensateArrays(bestmove);
  1717.             gameboard[bestblob] = 46;
  1718.             computerClicked(name, bestblob);
  1719.             gameboard[bestblob] = 2;
  1720.             trace ("moves " + bestblob + " to " + bestmove);
  1721.             computerDelay2.play();
  1722.             computerGoDelay.gotoAndStop(1);
  1723.         } // end else if
  1724.     }
  1725.     else if (canGo2)
  1726.     {
  1727.         bestmove = bestmove2;
  1728.         bestblob = bestblob2;
  1729.         if (canTake2)
  1730.         {
  1731.             gameboard[bestblob2] = 46;
  1732.             computerClicked(name, bestblob2);
  1733.             gameboard[bestblob2] = 1;
  1734.             computerGoDelay.play();
  1735.         }
  1736.         else
  1737.         {
  1738.             pos = compFull2.length - 1;
  1739.             newRandom = myRandom(0, pos);
  1740.             j = compFull2[newRandom];
  1741.             trace ("Move blob : " + j + " | " + pos + " | " + newRandom);
  1742.             bestblob2 = compensateArrays(j);
  1743.             compFull2.length = 0;
  1744.             if (compboard1[j - 22] == 1)
  1745.             {
  1746.                 compFull2.push(j - 22);
  1747.             } // end if
  1748.             if (compboard1[j - 21] == 1)
  1749.             {
  1750.                 compFull2.push(j - 21);
  1751.             } // end if
  1752.             if (compboard1[j - 20] == 1)
  1753.             {
  1754.                 compFull2.push(j - 20);
  1755.             } // end if
  1756.             if (compboard1[j - 19] == 1)
  1757.             {
  1758.                 compFull2.push(j - 19);
  1759.             } // end if
  1760.             if (compboard1[j - 18] == 1)
  1761.             {
  1762.                 compFull2.push(j - 18);
  1763.             } // end if
  1764.             if (compboard1[j - 12] == 1)
  1765.             {
  1766.                 compFull2.push(j - 12);
  1767.             } // end if
  1768.             if (compboard1[j - 8] == 1)
  1769.             {
  1770.                 compFull2.push(j - 8);
  1771.             } // end if
  1772.             if (compboard1[j - 2] == 1)
  1773.             {
  1774.                 compFull2.push(j - 2);
  1775.             } // end if
  1776.             if (compboard1[j + 2] == 1)
  1777.             {
  1778.                 compFull2.push(j + 2);
  1779.             } // end if
  1780.             if (compboard1[j + 8] == 1)
  1781.             {
  1782.                 compFull2.push(j + 8);
  1783.             } // end if
  1784.             if (compboard1[j + 10] == 1)
  1785.             {
  1786.                 compFull2.push(j + 10);
  1787.             } // end if
  1788.             if (compboard1[j + 12] == 1)
  1789.             {
  1790.                 compFull2.push(j + 12);
  1791.             } // end if
  1792.             if (compboard1[j + 18] == 1)
  1793.             {
  1794.                 compFull2.push(j + 18);
  1795.             } // end if
  1796.             if (compboard1[j + 19] == 1)
  1797.             {
  1798.                 compFull2.push(j + 19);
  1799.             } // end if
  1800.             if (compboard1[j + 20] == 1)
  1801.             {
  1802.                 compFull2.push(j + 20);
  1803.             } // end if
  1804.             if (compboard1[j + 21] == 1)
  1805.             {
  1806.                 compFull2.push(j + 21);
  1807.             } // end if
  1808.             if (compboard1[j + 22] == 1)
  1809.             {
  1810.                 compFull2.push(j + 22);
  1811.             } // end if
  1812.             pos = compFull2.length - 1;
  1813.             bestmove2 = myRandom(0, pos);
  1814.             bestmove2 = compFull2[bestmove2];
  1815.             trace (bestmove2 + " | " + compFull2);
  1816.             bestmove2 = compensateArrays(bestmove2);
  1817.             gameboard[bestblob2] = 46;
  1818.             blobToRemove = bestblob2;
  1819.             computerClicked(name, bestblob2);
  1820.             gameboard[bestblob2] = 2;
  1821.             trace ("moves " + bestblob2 + " to " + bestmove2);
  1822.             computerDelay2.play();
  1823.             computerGoDelay.gotoAndStop(1);
  1824.         } // end else if
  1825.     }
  1826.     else if (reds + blues < 64)
  1827.     {
  1828.         popup.gotoAndPlay("compPass");
  1829.     } // end else if
  1830. } // End of the function
  1831. function compensateArrays(move)
  1832. {
  1833.     if (move < 19)
  1834.     {
  1835.         move = move - 11;
  1836.     }
  1837.     else if (move < 29)
  1838.     {
  1839.         move = move - 13;
  1840.     }
  1841.     else if (move < 39)
  1842.     {
  1843.         move = move - 15;
  1844.     }
  1845.     else if (move < 49)
  1846.     {
  1847.         move = move - 17;
  1848.     }
  1849.     else if (move < 59)
  1850.     {
  1851.         move = move - 19;
  1852.     }
  1853.     else if (move < 69)
  1854.     {
  1855.         move = move - 21;
  1856.     }
  1857.     else if (move < 79)
  1858.     {
  1859.         move = move - 23;
  1860.     }
  1861.     else if (move < 89)
  1862.     {
  1863.         move = move - 25;
  1864.     } // end else if
  1865.     return (move);
  1866. } // End of the function
  1867. function debugShowBoard()
  1868. {
  1869.     trace (compboard1[11] + " | " + compboard1[12] + " | " + compboard1[13] + " | " + compboard1[14] + " | " + compboard1[15] + " | " + compboard1[16] + " | " + compboard1[17] + " | " + compboard1[18]);
  1870.     trace (compboard1[21] + " | " + compboard1[22] + " | " + compboard1[23] + " | " + compboard1[24] + " | " + compboard1[25] + " | " + compboard1[26] + " | " + compboard1[27] + " | " + compboard1[28]);
  1871.     trace (compboard1[31] + " | " + compboard1[32] + " | " + compboard1[33] + " | " + compboard1[34] + " | " + compboard1[35] + " | " + compboard1[36] + " | " + compboard1[37] + " | " + compboard1[38]);
  1872.     trace (compboard1[41] + " | " + compboard1[42] + " | " + compboard1[43] + " | " + compboard1[44] + " | " + compboard1[45] + " | " + compboard1[46] + " | " + compboard1[47] + " | " + compboard1[48]);
  1873.     trace (compboard1[51] + " | " + compboard1[52] + " | " + compboard1[53] + " | " + compboard1[54] + " | " + compboard1[55] + " | " + compboard1[56] + " | " + compboard1[57] + " | " + compboard1[58]);
  1874.     trace (compboard1[61] + " | " + compboard1[62] + " | " + compboard1[63] + " | " + compboard1[64] + " | " + compboard1[65] + " | " + compboard1[66] + " | " + compboard1[67] + " | " + compboard1[68]);
  1875.     trace (compboard1[71] + " | " + compboard1[72] + " | " + compboard1[73] + " | " + compboard1[74] + " | " + compboard1[75] + " | " + compboard1[76] + " | " + compboard1[77] + " | " + compboard1[78]);
  1876.     trace (compboard1[81] + " | " + compboard1[82] + " | " + compboard1[83] + " | " + compboard1[84] + " | " + compboard1[85] + " | " + compboard1[86] + " | " + compboard1[87] + " | " + compboard1[88]);
  1877.     trace (compFull);
  1878. } // End of the function
  1879. function copyArrays()
  1880. {
  1881.     for (i = 0; i < 8; i++)
  1882.     {
  1883.         compboard1[i + 11] = gameboard[i];
  1884.     } // end of for
  1885.     for (i = 8; i < 16; i++)
  1886.     {
  1887.         compboard1[i + 13] = gameboard[i];
  1888.     } // end of for
  1889.     for (i = 16; i < 24; i++)
  1890.     {
  1891.         compboard1[i + 15] = gameboard[i];
  1892.     } // end of for
  1893.     for (i = 24; i < 32; i++)
  1894.     {
  1895.         compboard1[i + 17] = gameboard[i];
  1896.     } // end of for
  1897.     for (i = 32; i < 40; i++)
  1898.     {
  1899.         compboard1[i + 19] = gameboard[i];
  1900.     } // end of for
  1901.     for (i = 40; i < 48; i++)
  1902.     {
  1903.         compboard1[i + 21] = gameboard[i];
  1904.     } // end of for
  1905.     for (i = 48; i < 56; i++)
  1906.     {
  1907.         compboard1[i + 23] = gameboard[i];
  1908.     } // end of for
  1909.     for (i = 56; i < 64; i++)
  1910.     {
  1911.         compboard1[i + 25] = gameboard[i];
  1912.     } // end of for
  1913. } // End of the function
  1914. function myRandom(minval, maxval)
  1915. {
  1916.     return (minval + Math.floor(Math.random() * (maxval + 1 - minval)));
  1917. } // End of the function
  1918. function attack(pos)
  1919. {
  1920.     attacked = 0;
  1921.     if (playersGo)
  1922.     {
  1923.         if (gameboard[pos + 1] == 2 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  1924.         {
  1925.             gameboard[pos + 1] = 6;
  1926.             ++attacked;
  1927.         } // end if
  1928.         if (gameboard[pos - 1] == 2 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  1929.         {
  1930.             gameboard[pos - 1] = 6;
  1931.             ++attacked;
  1932.         } // end if
  1933.         if (gameboard[pos + 9] == 2 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  1934.         {
  1935.             gameboard[pos + 9] = 6;
  1936.             ++attacked;
  1937.         } // end if
  1938.         if (gameboard[pos + 7] == 2 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  1939.         {
  1940.             gameboard[pos + 7] = 6;
  1941.             ++attacked;
  1942.         } // end if
  1943.         if (gameboard[pos + 8] == 2)
  1944.         {
  1945.             gameboard[pos + 8] = 6;
  1946.             ++attacked;
  1947.         } // end if
  1948.         if (gameboard[pos - 9] == 2 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  1949.         {
  1950.             gameboard[pos - 9] = 6;
  1951.             ++attacked;
  1952.         } // end if
  1953.         if (gameboard[pos - 7] == 2 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  1954.         {
  1955.             gameboard[pos - 7] = 6;
  1956.             ++attacked;
  1957.         } // end if
  1958.         if (gameboard[pos - 8] == 2)
  1959.         {
  1960.             gameboard[pos - 8] = 6;
  1961.             ++attacked;
  1962.         } // end if
  1963.     }
  1964.     else
  1965.     {
  1966.         if (gameboard[pos + 1] == 3 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  1967.         {
  1968.             gameboard[pos + 1] = 25;
  1969.             ++attacked;
  1970.         } // end if
  1971.         if (gameboard[pos - 1] == 3 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  1972.         {
  1973.             gameboard[pos - 1] = 25;
  1974.             ++attacked;
  1975.         } // end if
  1976.         if (gameboard[pos + 9] == 3 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  1977.         {
  1978.             gameboard[pos + 9] = 25;
  1979.             ++attacked;
  1980.         } // end if
  1981.         if (gameboard[pos + 7] == 3 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  1982.         {
  1983.             gameboard[pos + 7] = 25;
  1984.             ++attacked;
  1985.         } // end if
  1986.         if (gameboard[pos + 8] == 3)
  1987.         {
  1988.             gameboard[pos + 8] = 25;
  1989.             ++attacked;
  1990.         } // end if
  1991.         if (gameboard[pos - 9] == 3 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  1992.         {
  1993.             gameboard[pos - 9] = 25;
  1994.             ++attacked;
  1995.         } // end if
  1996.         if (gameboard[pos - 7] == 3 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  1997.         {
  1998.             gameboard[pos - 7] = 25;
  1999.             ++attacked;
  2000.         } // end if
  2001.         if (gameboard[pos - 8] == 3)
  2002.         {
  2003.             gameboard[pos - 8] = 25;
  2004.             ++attacked;
  2005.         } // end if
  2006.     } // end else if
  2007.     showBoard(true);
  2008.     if (_root.muted == false)
  2009.     {
  2010.         if (attacked >= 7)
  2011.         {
  2012.             sound_pass.start();
  2013.         }
  2014.         else if (attacked >= 5)
  2015.         {
  2016.             sound_attack2.start();
  2017.         }
  2018.         else if (attacked >= 3)
  2019.         {
  2020.             sound_attack.start();
  2021.         }
  2022.         else if (attacked >= 1)
  2023.         {
  2024.             sound_attack1.start();
  2025.         } // end else if
  2026.     } // end else if
  2027.     if (playersGo)
  2028.     {
  2029.         playersGo = false;
  2030.         playerHL.gotoAndStop(1);
  2031.         computerLight.gotoAndStop(2);
  2032.         computerGoDelay.play();
  2033.     }
  2034.     else
  2035.     {
  2036.         playersGo = true;
  2037.         playerHL.gotoAndStop(2);
  2038.         computerLight.gotoAndStop(1);
  2039.     } // end else if
  2040.     ++curGo;
  2041. } // End of the function
  2042. function clearClicked()
  2043. {
  2044.     for (i = 0; i < 64; i++)
  2045.     {
  2046.         if (gameboard[i] == 4 || gameboard[i] == 5)
  2047.         {
  2048.             gameboard[i] = 1;
  2049.         } // end if
  2050.     } // end of for
  2051. } // End of the function
  2052. function placeBlob(pos)
  2053. {
  2054.     if (_root.muted == false)
  2055.     {
  2056.         sound_spawn.start();
  2057.     } // end if
  2058.     if (playersGo)
  2059.     {
  2060.         gameboard[pos] = 3;
  2061.     }
  2062.     else
  2063.     {
  2064.         gameboard[pos] = 2;
  2065.     } // end else if
  2066.     clearClicked();
  2067.     showBoard(false);
  2068.     attack(pos);
  2069. } // End of the function
  2070. function moveBlob(pos)
  2071. {
  2072.     if (_root.muted == false)
  2073.     {
  2074.         sound_take.start();
  2075.     } // end if
  2076.     if (playersGo)
  2077.     {
  2078.         gameboard[pos] = 3;
  2079.     }
  2080.     else
  2081.     {
  2082.         gameboard[pos] = 2;
  2083.     } // end else if
  2084.     gameboard[selectedpos] = 1;
  2085.     clearClicked();
  2086.     showBoard(false);
  2087.     attack(pos);
  2088. } // End of the function
  2089. function blobClicked(blob, pos)
  2090. {
  2091.     if (_root.muted == false)
  2092.     {
  2093.         sound_select.start();
  2094.     } // end if
  2095.     selected = blob;
  2096.     selectedpos = pos;
  2097.     clearClicked();
  2098.     if (gameboard[pos + 1] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  2099.     {
  2100.         gameboard[pos + 1] = 4;
  2101.     } // end if
  2102.     if (gameboard[pos + 2] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2103.     {
  2104.         gameboard[pos + 2] = 5;
  2105.     } // end if
  2106.     if (gameboard[pos + 8] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63)
  2107.     {
  2108.         gameboard[pos + 8] = 4;
  2109.     } // end if
  2110.     if (gameboard[pos + 16] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63)
  2111.     {
  2112.         gameboard[pos + 16] = 5;
  2113.     } // end if
  2114.     if (gameboard[pos - 1] == 1 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2115.     {
  2116.         gameboard[pos - 1] = 4;
  2117.     } // end if
  2118.     if (gameboard[pos - 2] == 1 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2119.     {
  2120.         gameboard[pos - 2] = 5;
  2121.     } // end if
  2122.     if (gameboard[pos - 8] == 1 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7)
  2123.     {
  2124.         gameboard[pos - 8] = 4;
  2125.     } // end if
  2126.     if (gameboard[pos - 16] == 1 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7)
  2127.     {
  2128.         gameboard[pos - 16] = 5;
  2129.     } // end if
  2130.     if (gameboard[pos + 7] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48)
  2131.     {
  2132.         gameboard[pos + 7] = 4;
  2133.     } // end if
  2134.     if (gameboard[pos + 6] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2135.     {
  2136.         gameboard[pos + 6] = 5;
  2137.     } // end if
  2138.     if (gameboard[pos + 14] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2139.     {
  2140.         gameboard[pos + 14] = 5;
  2141.     } // end if
  2142.     if (gameboard[pos + 15] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48)
  2143.     {
  2144.         gameboard[pos + 15] = 5;
  2145.     } // end if
  2146.     if (gameboard[pos + 9] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55)
  2147.     {
  2148.         gameboard[pos + 9] = 4;
  2149.     } // end if
  2150.     if (gameboard[pos + 10] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2151.     {
  2152.         gameboard[pos + 10] = 5;
  2153.     } // end if
  2154.     if (gameboard[pos + 17] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55)
  2155.     {
  2156.         gameboard[pos + 17] = 5;
  2157.     } // end if
  2158.     if (gameboard[pos + 18] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2159.     {
  2160.         gameboard[pos + 18] = 5;
  2161.     } // end if
  2162.     if (gameboard[pos - 7] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6)
  2163.     {
  2164.         gameboard[pos - 7] = 4;
  2165.     } // end if
  2166.     if (gameboard[pos - 6] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2167.     {
  2168.         gameboard[pos - 6] = 5;
  2169.     } // end if
  2170.     if (gameboard[pos - 14] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2171.     {
  2172.         gameboard[pos - 14] = 5;
  2173.     } // end if
  2174.     if (gameboard[pos - 15] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6)
  2175.     {
  2176.         gameboard[pos - 15] = 5;
  2177.     } // end if
  2178.     if (gameboard[pos - 9] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2179.     {
  2180.         gameboard[pos - 9] = 4;
  2181.     } // end if
  2182.     if (gameboard[pos - 10] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2183.     {
  2184.         gameboard[pos - 10] = 5;
  2185.     } // end if
  2186.     if (gameboard[pos - 17] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2187.     {
  2188.         gameboard[pos - 17] = 5;
  2189.     } // end if
  2190.     if (gameboard[pos - 18] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2191.     {
  2192.         gameboard[pos - 18] = 5;
  2193.     } // end if
  2194.     gameboard[pos] = 45;
  2195.     showBoard(false);
  2196.     gameboard[pos] = 3;
  2197. } // End of the function
  2198. function computerClicked(blob, pos)
  2199. {
  2200.     selected = blob;
  2201.     selectedpos = pos;
  2202.     if (gameboard[pos + 1] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  2203.     {
  2204.         gameboard[pos + 1] = 4;
  2205.     } // end if
  2206.     if (gameboard[pos + 2] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2207.     {
  2208.         gameboard[pos + 2] = 5;
  2209.     } // end if
  2210.     if (gameboard[pos + 8] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63)
  2211.     {
  2212.         gameboard[pos + 8] = 4;
  2213.     } // end if
  2214.     if (gameboard[pos + 16] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63)
  2215.     {
  2216.         gameboard[pos + 16] = 5;
  2217.     } // end if
  2218.     if (gameboard[pos - 1] == 1 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2219.     {
  2220.         gameboard[pos - 1] = 4;
  2221.     } // end if
  2222.     if (gameboard[pos - 2] == 1 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2223.     {
  2224.         gameboard[pos - 2] = 5;
  2225.     } // end if
  2226.     if (gameboard[pos - 8] == 1 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7)
  2227.     {
  2228.         gameboard[pos - 8] = 4;
  2229.     } // end if
  2230.     if (gameboard[pos - 16] == 1 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7)
  2231.     {
  2232.         gameboard[pos - 16] = 5;
  2233.     } // end if
  2234.     if (gameboard[pos + 7] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48)
  2235.     {
  2236.         gameboard[pos + 7] = 4;
  2237.     } // end if
  2238.     if (gameboard[pos + 6] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2239.     {
  2240.         gameboard[pos + 6] = 5;
  2241.     } // end if
  2242.     if (gameboard[pos + 14] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2243.     {
  2244.         gameboard[pos + 14] = 5;
  2245.     } // end if
  2246.     if (gameboard[pos + 15] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48)
  2247.     {
  2248.         gameboard[pos + 15] = 5;
  2249.     } // end if
  2250.     if (gameboard[pos + 9] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55)
  2251.     {
  2252.         gameboard[pos + 9] = 4;
  2253.     } // end if
  2254.     if (gameboard[pos + 10] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2255.     {
  2256.         gameboard[pos + 10] = 5;
  2257.     } // end if
  2258.     if (gameboard[pos + 17] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55)
  2259.     {
  2260.         gameboard[pos + 17] = 5;
  2261.     } // end if
  2262.     if (gameboard[pos + 18] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2263.     {
  2264.         gameboard[pos + 18] = 5;
  2265.     } // end if
  2266.     if (gameboard[pos - 7] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6)
  2267.     {
  2268.         gameboard[pos - 7] = 4;
  2269.     } // end if
  2270.     if (gameboard[pos - 6] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2271.     {
  2272.         gameboard[pos - 6] = 5;
  2273.     } // end if
  2274.     if (gameboard[pos - 14] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  2275.     {
  2276.         gameboard[pos - 14] = 5;
  2277.     } // end if
  2278.     if (gameboard[pos - 15] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6)
  2279.     {
  2280.         gameboard[pos - 15] = 5;
  2281.     } // end if
  2282.     if (gameboard[pos - 9] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2283.     {
  2284.         gameboard[pos - 9] = 4;
  2285.     } // end if
  2286.     if (gameboard[pos - 10] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2287.     {
  2288.         gameboard[pos - 10] = 5;
  2289.     } // end if
  2290.     if (gameboard[pos - 17] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2291.     {
  2292.         gameboard[pos - 17] = 5;
  2293.     } // end if
  2294.     if (gameboard[pos - 18] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  2295.     {
  2296.         gameboard[pos - 18] = 5;
  2297.     } // end if
  2298.     showBoard(false);
  2299. } // End of the function
  2300. function makeBoard()
  2301. {
  2302.     var row;
  2303.     var col;
  2304.     var name;
  2305.     var count = 1;
  2306.     counter = 0;
  2307.     for (row = 0; row < 8; row++)
  2308.     {
  2309.         for (col = 0; col < 8; col++)
  2310.         {
  2311.             name = "board" + row + "_" + col;
  2312.             duplicateMovieClip("piece", name, count++);
  2313.             eval(name).row = row;
  2314.             eval(name).col = col;
  2315.             eval(name).name = name;
  2316.             eval(name).pos = counter;
  2317.             ++counter;
  2318.         } // end of for
  2319.     } // end of for
  2320.     board0_0._x = 241.600000;
  2321.     board0_0._y = 42.900000;
  2322.     board0_1._x = 275.200000;
  2323.     board0_1._y = 58.500000;
  2324.     board0_2._x = 308.900000;
  2325.     board0_2._y = 74.200000;
  2326.     board0_3._x = 342.500000;
  2327.     board0_3._y = 89.800000;
  2328.     board0_4._x = 376.100000;
  2329.     board0_4._y = 105.400000;
  2330.     board0_5._x = 409.800000;
  2331.     board0_5._y = 121.200000;
  2332.     board0_6._x = 443.400000;
  2333.     board0_6._y = 136.700000;
  2334.     board0_7._x = 477;
  2335.     board0_7._y = 152.300000;
  2336.     board1_0._x = 207.900000;
  2337.     board1_0._y = 58.800000;
  2338.     board1_1._x = 241.600000;
  2339.     board1_1._y = 74.200000;
  2340.     board1_2._x = 275.200000;
  2341.     board1_2._y = 89.800000;
  2342.     board1_3._x = 308.900000;
  2343.     board1_3._y = 105.200000;
  2344.     board1_4._x = 342.500000;
  2345.     board1_4._y = 121.100000;
  2346.     board1_5._x = 376.100000;
  2347.     board1_5._y = 136.700000;
  2348.     board1_6._x = 409.800000;
  2349.     board1_6._y = 152.300000;
  2350.     board1_7._x = 443.400000;
  2351.     board1_7._y = 167.900000;
  2352.     board2_0._x = 174.300000;
  2353.     board2_0._y = 74.200000;
  2354.     board2_1._x = 207.900000;
  2355.     board2_1._y = 89.800000;
  2356.     board2_2._x = 241.600000;
  2357.     board2_2._y = 105.400000;
  2358.     board2_3._x = 275.200000;
  2359.     board2_3._y = 121.100000;
  2360.     board2_4._x = 308.900000;
  2361.     board2_4._y = 136.700000;
  2362.     board2_5._x = 342.500000;
  2363.     board2_5._y = 152.300000;
  2364.     board2_6._x = 376.100000;
  2365.     board2_6._y = 167.900000;
  2366.     board2_7._x = 409.800000;
  2367.     board2_7._y = 183.600000;
  2368.     board3_0._x = 140.700000;
  2369.     board3_0._y = 89.900000;
  2370.     board3_1._x = 174.300000;
  2371.     board3_1._y = 105.400000;
  2372.     board3_2._x = 207.900000;
  2373.     board3_2._y = 121.100000;
  2374.     board3_3._x = 241.600000;
  2375.     board3_3._y = 136.700000;
  2376.     board3_4._x = 275.200000;
  2377.     board3_4._y = 152.300000;
  2378.     board3_5._x = 308.900000;
  2379.     board3_5._y = 167.900000;
  2380.     board3_6._x = 342.500000;
  2381.     board3_6._y = 183.600000;
  2382.     board3_7._x = 376.100000;
  2383.     board3_7._y = 199.200000;
  2384.     board4_0._x = 107.100000;
  2385.     board4_0._y = 105.400000;
  2386.     board4_1._x = 140.700000;
  2387.     board4_1._y = 121.100000;
  2388.     board4_2._x = 174.300000;
  2389.     board4_2._y = 136.700000;
  2390.     board4_3._x = 207.900000;
  2391.     board4_3._y = 152.300000;
  2392.     board4_4._x = 241.600000;
  2393.     board4_4._y = 167.900000;
  2394.     board4_5._x = 275.200000;
  2395.     board4_5._y = 183.600000;
  2396.     board4_6._x = 308.900000;
  2397.     board4_6._y = 199.200000;
  2398.     board4_7._x = 342.500000;
  2399.     board4_7._y = 214.800000;
  2400.     board5_0._x = 73.400000;
  2401.     board5_0._y = 121.100000;
  2402.     board5_1._x = 107.100000;
  2403.     board5_1._y = 136.700000;
  2404.     board5_2._x = 140.700000;
  2405.     board5_2._y = 152.300000;
  2406.     board5_3._x = 174.300000;
  2407.     board5_3._y = 167.900000;
  2408.     board5_4._x = 208;
  2409.     board5_4._y = 183.600000;
  2410.     board5_5._x = 241.600000;
  2411.     board5_5._y = 199.200000;
  2412.     board5_6._x = 275.200000;
  2413.     board5_6._y = 214.800000;
  2414.     board5_7._x = 308.900000;
  2415.     board5_7._y = 230.400000;
  2416.     board6_0._x = 39.800000;
  2417.     board6_0._y = 136.700000;
  2418.     board6_1._x = 73.400000;
  2419.     board6_1._y = 152.300000;
  2420.     board6_2._x = 107.100000;
  2421.     board6_2._y = 167.900000;
  2422.     board6_3._x = 140.700000;
  2423.     board6_3._y = 183.600000;
  2424.     board6_4._x = 174.300000;
  2425.     board6_4._y = 199.200000;
  2426.     board6_5._x = 207.900000;
  2427.     board6_5._y = 214.800000;
  2428.     board6_6._x = 242;
  2429.     board6_6._y = 230.400000;
  2430.     board6_7._x = 275.200000;
  2431.     board6_7._y = 246.100000;
  2432.     board7_0._x = 6.300000;
  2433.     board7_0._y = 152.300000;
  2434.     board7_1._x = 39.800000;
  2435.     board7_1._y = 167.900000;
  2436.     board7_2._x = 73.400000;
  2437.     board7_2._y = 183.600000;
  2438.     board7_3._x = 107.100000;
  2439.     board7_3._y = 199.200000;
  2440.     board7_4._x = 140.700000;
  2441.     board7_4._y = 214.800000;
  2442.     board7_5._x = 174.300000;
  2443.     board7_5._y = 230.400000;
  2444.     board7_6._x = 207.900000;
  2445.     board7_6._y = 246.300000;
  2446.     board7_7._x = 241.600000;
  2447.     board7_7._y = 261.800000;
  2448.     for (row = 0; row < 8; row++)
  2449.     {
  2450.         for (col = 0; col < 8; col++)
  2451.         {
  2452.             name = "board" + row + "_" + col;
  2453.             eval(name)._x = eval(name)._x + 34;
  2454.             eval(name)._y = eval(name)._y + 40;
  2455.         } // end of for
  2456.     } // end of for
  2457.     duplicateMovieClip("message", "popup", count++);
  2458.     duplicateMovieClip("message", "popup2", count++);
  2459.     popup._x = 275;
  2460.     popup._y = 200;
  2461.     popup2._x = 275;
  2462.     popup2._y = 200;
  2463. } // End of the function
  2464. function initGame()
  2465. {
  2466.     var row;
  2467.     var col;
  2468.     var name;
  2469.     var count = 1;
  2470.     for (i = 0; i < 100; i++)
  2471.     {
  2472.         gameboard[i] = 1;
  2473.         compboard1[i] = 0;
  2474.         compboard2[i] = 0;
  2475.         compboard3[i] = 0;
  2476.     } // end of for
  2477.     gameboard[0] = 3;
  2478.     gameboard[56] = 3;
  2479.     gameboard[7] = 2;
  2480.     gameboard[63] = 2;
  2481.     if (arena == 4)
  2482.     {
  2483.         gameboard[27] = 65;
  2484.         gameboard[28] = 65;
  2485.         gameboard[35] = 65;
  2486.         gameboard[36] = 65;
  2487.         gameboard[18] = 65;
  2488.         gameboard[21] = 65;
  2489.         gameboard[42] = 65;
  2490.         gameboard[45] = 65;
  2491.     }
  2492.     else if (arena == 2)
  2493.     {
  2494.         gameboard[1] = 65;
  2495.         gameboard[8] = 65;
  2496.         gameboard[6] = 65;
  2497.         gameboard[15] = 65;
  2498.         gameboard[48] = 65;
  2499.         gameboard[57] = 65;
  2500.         gameboard[55] = 65;
  2501.         gameboard[62] = 65;
  2502.     }
  2503.     else if (arena == 6)
  2504.     {
  2505.         gameboard[27] = 65;
  2506.         gameboard[28] = 65;
  2507.         gameboard[35] = 65;
  2508.         gameboard[36] = 65;
  2509.         gameboard[18] = 65;
  2510.         gameboard[21] = 65;
  2511.         gameboard[42] = 65;
  2512.         gameboard[45] = 65;
  2513.         gameboard[9] = 65;
  2514.         gameboard[14] = 65;
  2515.         gameboard[49] = 65;
  2516.         gameboard[54] = 65;
  2517.     }
  2518.     else if (arena == 5)
  2519.     {
  2520.         gameboard[19] = 65;
  2521.         gameboard[20] = 65;
  2522.         gameboard[26] = 65;
  2523.         gameboard[34] = 65;
  2524.         gameboard[29] = 65;
  2525.         gameboard[37] = 65;
  2526.         gameboard[43] = 65;
  2527.         gameboard[44] = 65;
  2528.         gameboard[9] = 65;
  2529.         gameboard[14] = 65;
  2530.         gameboard[49] = 65;
  2531.         gameboard[54] = 65;
  2532.     }
  2533.     else if (arena == 3)
  2534.     {
  2535.         gameboard[2] = 65;
  2536.         gameboard[10] = 65;
  2537.         gameboard[5] = 65;
  2538.         gameboard[13] = 65;
  2539.         gameboard[16] = 65;
  2540.         gameboard[17] = 65;
  2541.         gameboard[22] = 65;
  2542.         gameboard[23] = 65;
  2543.         gameboard[50] = 65;
  2544.         gameboard[58] = 65;
  2545.         gameboard[53] = 65;
  2546.         gameboard[61] = 65;
  2547.         gameboard[40] = 65;
  2548.         gameboard[41] = 65;
  2549.         gameboard[46] = 65;
  2550.         gameboard[47] = 65;
  2551.     } // end else if
  2552.     curGo = 0;
  2553.     playerHL.gotoAndStop(2);
  2554.     showBoard();
  2555. } // End of the function
  2556. function showBoard(animate)
  2557. {
  2558.     bluecount = 0;
  2559.     redcount = 0;
  2560.     for (i = 11; i < 19; i++)
  2561.     {
  2562.         j = i - 11;
  2563.         name = "board0_" + j;
  2564.         if ((gameboard[i - 11] == 6 || gameboard[i - 11] == 25 || gameboard[i - 11] == 13 || gameboard[i - 11] == 32) && animate)
  2565.         {
  2566.             eval(name).gotoAndPlay(gameboard[i - 11]);
  2567.             if (playersGo)
  2568.             {
  2569.                 gameboard[i - 11] = 3;
  2570.             }
  2571.             else
  2572.             {
  2573.                 gameboard[i - 11] = 2;
  2574.             } // end else if
  2575.             continue;
  2576.         } // end if
  2577.         eval(name).gotoAndStop(gameboard[i - 11]);
  2578.     } // end of for
  2579.     for (i = 21; i < 29; i++)
  2580.     {
  2581.         j = i - 21;
  2582.         name = "board1_" + j;
  2583.         if ((gameboard[i - 13] == 6 || gameboard[i - 13] == 25 || gameboard[i - 13] == 13 || gameboard[i - 13] == 32) && animate)
  2584.         {
  2585.             eval(name).gotoAndPlay(gameboard[i - 13]);
  2586.             if (playersGo)
  2587.             {
  2588.                 gameboard[i - 13] = 3;
  2589.             }
  2590.             else
  2591.             {
  2592.                 gameboard[i - 13] = 2;
  2593.             } // end else if
  2594.             continue;
  2595.         } // end if
  2596.         eval(name).gotoAndStop(gameboard[i - 13]);
  2597.     } // end of for
  2598.     for (i = 31; i < 39; i++)
  2599.     {
  2600.         j = i - 31;
  2601.         name = "board2_" + j;
  2602.         if ((gameboard[i - 15] == 6 || gameboard[i - 15] == 25 || gameboard[i - 15] == 13 || gameboard[i - 15] == 32) && animate)
  2603.         {
  2604.             eval(name).gotoAndPlay(gameboard[i - 15]);
  2605.             if (playersGo)
  2606.             {
  2607.                 gameboard[i - 15] = 3;
  2608.             }
  2609.             else
  2610.             {
  2611.                 gameboard[i - 15] = 2;
  2612.             } // end else if
  2613.             continue;
  2614.         } // end if
  2615.         eval(name).gotoAndStop(gameboard[i - 15]);
  2616.     } // end of for
  2617.     for (i = 41; i < 49; i++)
  2618.     {
  2619.         j = i - 41;
  2620.         name = "board3_" + j;
  2621.         if ((gameboard[i - 17] == 6 || gameboard[i - 17] == 25 || gameboard[i - 17] == 13 || gameboard[i - 17] == 32) && animate)
  2622.         {
  2623.             eval(name).gotoAndPlay(gameboard[i - 17]);
  2624.             if (playersGo)
  2625.             {
  2626.                 gameboard[i - 17] = 3;
  2627.             }
  2628.             else
  2629.             {
  2630.                 gameboard[i - 17] = 2;
  2631.             } // end else if
  2632.             continue;
  2633.         } // end if
  2634.         eval(name).gotoAndStop(gameboard[i - 17]);
  2635.     } // end of for
  2636.     for (i = 51; i < 59; i++)
  2637.     {
  2638.         j = i - 51;
  2639.         name = "board4_" + j;
  2640.         if ((gameboard[i - 19] == 6 || gameboard[i - 19] == 25 || gameboard[i - 19] == 13 || gameboard[i - 19] == 32) && animate)
  2641.         {
  2642.             eval(name).gotoAndPlay(gameboard[i - 19]);
  2643.             if (playersGo)
  2644.             {
  2645.                 gameboard[i - 19] = 3;
  2646.             }
  2647.             else
  2648.             {
  2649.                 gameboard[i - 19] = 2;
  2650.             } // end else if
  2651.             continue;
  2652.         } // end if
  2653.         eval(name).gotoAndStop(gameboard[i - 19]);
  2654.     } // end of for
  2655.     for (i = 61; i < 69; i++)
  2656.     {
  2657.         j = i - 61;
  2658.         name = "board5_" + j;
  2659.         if ((gameboard[i - 21] == 6 || gameboard[i - 21] == 25 || gameboard[i - 21] == 13 || gameboard[i - 21] == 32) && animate)
  2660.         {
  2661.             eval(name).gotoAndPlay(gameboard[i - 21]);
  2662.             if (playersGo)
  2663.             {
  2664.                 gameboard[i - 21] = 3;
  2665.             }
  2666.             else
  2667.             {
  2668.                 gameboard[i - 21] = 2;
  2669.             } // end else if
  2670.             continue;
  2671.         } // end if
  2672.         eval(name).gotoAndStop(gameboard[i - 21]);
  2673.     } // end of for
  2674.     for (i = 71; i < 79; i++)
  2675.     {
  2676.         j = i - 71;
  2677.         name = "board6_" + j;
  2678.         if ((gameboard[i - 23] == 6 || gameboard[i - 23] == 25 || gameboard[i - 23] == 13 || gameboard[i - 23] == 32) && animate)
  2679.         {
  2680.             eval(name).gotoAndPlay(gameboard[i - 23]);
  2681.             if (playersGo)
  2682.             {
  2683.                 gameboard[i - 23] = 3;
  2684.             }
  2685.             else
  2686.             {
  2687.                 gameboard[i - 23] = 2;
  2688.             } // end else if
  2689.             continue;
  2690.         } // end if
  2691.         eval(name).gotoAndStop(gameboard[i - 23]);
  2692.     } // end of for
  2693.     for (i = 81; i < 89; i++)
  2694.     {
  2695.         j = i - 81;
  2696.         name = "board7_" + j;
  2697.         if ((gameboard[i - 25] == 6 || gameboard[i - 25] == 25 || gameboard[i - 25] == 13 || gameboard[i - 25] == 32) && animate)
  2698.         {
  2699.             eval(name).gotoAndPlay(gameboard[i - 25]);
  2700.             if (playersGo)
  2701.             {
  2702.                 gameboard[i - 25] = 3;
  2703.             }
  2704.             else
  2705.             {
  2706.                 gameboard[i - 25] = 2;
  2707.             } // end else if
  2708.             continue;
  2709.         } // end if
  2710.         eval(name).gotoAndStop(gameboard[i - 25]);
  2711.     } // end of for
  2712.     updateScores();
  2713. } // End of the function
  2714. function updateScores()
  2715. {
  2716.     redcount = 0;
  2717.     bluecount = 0;
  2718.     for (i = 0; i < 64; i++)
  2719.     {
  2720.         if (gameboard[i] == 2 || gameboard[i] == 46)
  2721.         {
  2722.             ++redcount;
  2723.             continue;
  2724.         } // end if
  2725.         if (gameboard[i] == 3 || gameboard[i] == 45)
  2726.         {
  2727.             ++bluecount;
  2728.         } // end if
  2729.     } // end of for
  2730.     blues = bluecount;
  2731.     reds = redcount;
  2732.     if (redcount + bluecount == numTiles || redcount == 0 || bluecount == 0)
  2733.     {
  2734.         endGame(redcount, bluecount);
  2735.     } // end if
  2736. } // End of the function
  2737. function removeMovedBlob()
  2738. {
  2739.     trace ("remove " + blobToRemove);
  2740.     if (playersGo)
  2741.     {
  2742.         eval(blobToRemove).gotoAndPlay(50);
  2743.     }
  2744.     else
  2745.     {
  2746.         eval(blobToRemove).gotoAndPlay(57);
  2747.     } // end else if
  2748. } // End of the function
  2749. function updateBlob(piece, frame)
  2750. {
  2751.     eval(piece).gotoAndPlay(frame);
  2752. } // End of the function
  2753. function endGame()
  2754. {
  2755.     trace ("endgame");
  2756.     if (reds == bluecount)
  2757.     {
  2758.         popup2.gotoAndPlay(95);
  2759.         trace ("draw");
  2760.     }
  2761.     else if (reds > blues)
  2762.     {
  2763.         popup2.gotoAndPlay(180);
  2764.         trace ("red");
  2765.     }
  2766.     else if (blues > reds)
  2767.     {
  2768.         popup2.gotoAndPlay(263);
  2769.         trace ("blue");
  2770.     }
  2771.     else
  2772.     {
  2773.         trace ("no win");
  2774.     } // end else if
  2775.     trace (gameboard);
  2776. } // End of the function
  2777. function removePieces()
  2778. {
  2779.     var row;
  2780.     var col;
  2781.     var name;
  2782.     var count = 1;
  2783.     counter = 0;
  2784.     for (row = 0; row < 8; row++)
  2785.     {
  2786.         for (col = 0; col < 8; col++)
  2787.         {
  2788.             name = "board" + row + "_" + col;
  2789.             removeMovieClip (name);
  2790.             ++counter;
  2791.         } // end of for
  2792.     } // end of for
  2793. } // End of the function
  2794. function nextRound()
  2795. {
  2796.     popup.gotoAndStop(1);
  2797.     gotoAndPlay(31);
  2798.     trace ("bluewon");
  2799. } // End of the function
  2800. function gameOver()
  2801. {
  2802.     gotoAndPlay(36);
  2803. } // End of the function
  2804. sound_drums.start(0, 999);
  2805. ++numGames;
  2806. bestmove = 0;
  2807. bestblob = 0;
  2808. PLAYER = 3;
  2809. COMPUTER = 2;
  2810. OFFBOARD = 4;
  2811. jumpMove = false;
  2812. blobToRemove = 0;
  2813. selected = 0;
  2814. selectedpos = 0;
  2815. playersGo = true;
  2816. flip = new Array(8);
  2817. gameboard = new Array(100);
  2818. compboard1 = new Array(100);
  2819. compboard2 = new Array(100);
  2820. compboard3 = new Array(100);
  2821. compFull = new Array();
  2822. compFull2 = new Array();
  2823. board = new Array(64);
  2824. cBoard = new Array(64);
  2825. pBoard = new Array(64);
  2826. makeBoard();
  2827. initGame();
  2828. trace ("-------------------------------------");
  2829. debugShowBoard();
  2830. stop ();
  2831.  
  2832. // [Action in Frame 35]
  2833. gotoAndStop(34);
  2834.  
  2835. // [Action in Frame 36]
  2836. if (_root.muted == false)
  2837. {
  2838.     _root.sound_laugh.start();
  2839. } // end if
  2840. sound_drums.stop();
  2841.  
  2842. stop ();
  2843.  
  2844. // [Action in Frame 37]
  2845. loadMovie("http://www.kwikgames.com/adverts/blobwars_ad.swf", _root.promo);
  2846. sound_drums.stop();
  2847.  
  2848. // [Action in Frame 159]
  2849. stop ();
  2850.  
  2851. // [Action in Frame 160]
  2852. stop ();
  2853.  
  2854. // [Action in Frame 161]
  2855. stop ();
  2856.  
  2857. // [Action in Frame 162]
  2858. stop ();
  2859.  
  2860. // [Action in Frame 189]
  2861. trace ("first scene blink");
  2862.  
  2863. // [Action in Frame 191]
  2864. function delay(length)
  2865. {
  2866.     x = getTimer();
  2867.     do
  2868.     {
  2869.         y = getTimer();
  2870.     } while (y < x + length)
  2871. } // End of the function
  2872. function compensateArrays(move)
  2873. {
  2874.     if (move < 19)
  2875.     {
  2876.         move = move - 11;
  2877.     }
  2878.     else if (move < 29)
  2879.     {
  2880.         move = move - 13;
  2881.     }
  2882.     else if (move < 39)
  2883.     {
  2884.         move = move - 15;
  2885.     }
  2886.     else if (move < 49)
  2887.     {
  2888.         move = move - 17;
  2889.     }
  2890.     else if (move < 59)
  2891.     {
  2892.         move = move - 19;
  2893.     }
  2894.     else if (move < 69)
  2895.     {
  2896.         move = move - 21;
  2897.     }
  2898.     else if (move < 79)
  2899.     {
  2900.         move = move - 23;
  2901.     }
  2902.     else if (move < 89)
  2903.     {
  2904.         move = move - 25;
  2905.     } // end else if
  2906.     return (move);
  2907. } // End of the function
  2908. function debugShowBoard()
  2909. {
  2910.     trace (compboard1[11] + " | " + compboard1[12] + " | " + compboard1[13] + " | " + compboard1[14] + " | " + compboard1[15] + " | " + compboard1[16] + " | " + compboard1[17] + " | " + compboard1[18]);
  2911.     trace (compboard1[21] + " | " + compboard1[22] + " | " + compboard1[23] + " | " + compboard1[24] + " | " + compboard1[25] + " | " + compboard1[26] + " | " + compboard1[27] + " | " + compboard1[28]);
  2912.     trace (compboard1[31] + " | " + compboard1[32] + " | " + compboard1[33] + " | " + compboard1[34] + " | " + compboard1[35] + " | " + compboard1[36] + " | " + compboard1[37] + " | " + compboard1[38]);
  2913.     trace (compboard1[41] + " | " + compboard1[42] + " | " + compboard1[43] + " | " + compboard1[44] + " | " + compboard1[45] + " | " + compboard1[46] + " | " + compboard1[47] + " | " + compboard1[48]);
  2914.     trace (compboard1[51] + " | " + compboard1[52] + " | " + compboard1[53] + " | " + compboard1[54] + " | " + compboard1[55] + " | " + compboard1[56] + " | " + compboard1[57] + " | " + compboard1[58]);
  2915.     trace (compboard1[61] + " | " + compboard1[62] + " | " + compboard1[63] + " | " + compboard1[64] + " | " + compboard1[65] + " | " + compboard1[66] + " | " + compboard1[67] + " | " + compboard1[68]);
  2916.     trace (compboard1[71] + " | " + compboard1[72] + " | " + compboard1[73] + " | " + compboard1[74] + " | " + compboard1[75] + " | " + compboard1[76] + " | " + compboard1[77] + " | " + compboard1[78]);
  2917.     trace (compboard1[81] + " | " + compboard1[82] + " | " + compboard1[83] + " | " + compboard1[84] + " | " + compboard1[85] + " | " + compboard1[86] + " | " + compboard1[87] + " | " + compboard1[88]);
  2918.     trace (compFull);
  2919. } // End of the function
  2920. function copyArrays()
  2921. {
  2922.     for (i = 0; i < 8; i++)
  2923.     {
  2924.         compboard1[i + 11] = gameboard[i];
  2925.     } // end of for
  2926.     for (i = 8; i < 16; i++)
  2927.     {
  2928.         compboard1[i + 13] = gameboard[i];
  2929.     } // end of for
  2930.     for (i = 16; i < 24; i++)
  2931.     {
  2932.         compboard1[i + 15] = gameboard[i];
  2933.     } // end of for
  2934.     for (i = 24; i < 32; i++)
  2935.     {
  2936.         compboard1[i + 17] = gameboard[i];
  2937.     } // end of for
  2938.     for (i = 32; i < 40; i++)
  2939.     {
  2940.         compboard1[i + 19] = gameboard[i];
  2941.     } // end of for
  2942.     for (i = 40; i < 48; i++)
  2943.     {
  2944.         compboard1[i + 21] = gameboard[i];
  2945.     } // end of for
  2946.     for (i = 48; i < 56; i++)
  2947.     {
  2948.         compboard1[i + 23] = gameboard[i];
  2949.     } // end of for
  2950.     for (i = 56; i < 64; i++)
  2951.     {
  2952.         compboard1[i + 25] = gameboard[i];
  2953.     } // end of for
  2954. } // End of the function
  2955. function myRandom(minval, maxval)
  2956. {
  2957.     return (minval + Math.floor(Math.random() * (maxval + 1 - minval)));
  2958. } // End of the function
  2959. function attack(pos)
  2960. {
  2961.     attacked = 0;
  2962.     if (playersGo)
  2963.     {
  2964.         if (gameboard[pos + 1] == 2 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  2965.         {
  2966.             gameboard[pos + 1] = 6;
  2967.             ++attacked;
  2968.         } // end if
  2969.         if (gameboard[pos - 1] == 2 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2970.         {
  2971.             gameboard[pos - 1] = 6;
  2972.             ++attacked;
  2973.         } // end if
  2974.         if (gameboard[pos + 9] == 2 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  2975.         {
  2976.             gameboard[pos + 9] = 6;
  2977.             ++attacked;
  2978.         } // end if
  2979.         if (gameboard[pos + 7] == 2 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2980.         {
  2981.             gameboard[pos + 7] = 6;
  2982.             ++attacked;
  2983.         } // end if
  2984.         if (gameboard[pos + 8] == 2)
  2985.         {
  2986.             gameboard[pos + 8] = 6;
  2987.             ++attacked;
  2988.         } // end if
  2989.         if (gameboard[pos - 9] == 2 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  2990.         {
  2991.             gameboard[pos - 9] = 6;
  2992.             ++attacked;
  2993.         } // end if
  2994.         if (gameboard[pos - 7] == 2 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  2995.         {
  2996.             gameboard[pos - 7] = 6;
  2997.             ++attacked;
  2998.         } // end if
  2999.         if (gameboard[pos - 8] == 2)
  3000.         {
  3001.             gameboard[pos - 8] = 6;
  3002.             ++attacked;
  3003.         } // end if
  3004.     }
  3005.     else
  3006.     {
  3007.         if (gameboard[pos + 1] == 3 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  3008.         {
  3009.             gameboard[pos + 1] = 25;
  3010.             ++attacked;
  3011.         } // end if
  3012.         if (gameboard[pos - 1] == 3 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3013.         {
  3014.             gameboard[pos - 1] = 25;
  3015.             ++attacked;
  3016.         } // end if
  3017.         if (gameboard[pos + 9] == 3 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  3018.         {
  3019.             gameboard[pos + 9] = 25;
  3020.             ++attacked;
  3021.         } // end if
  3022.         if (gameboard[pos + 7] == 3 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3023.         {
  3024.             gameboard[pos + 7] = 25;
  3025.             ++attacked;
  3026.         } // end if
  3027.         if (gameboard[pos + 8] == 3)
  3028.         {
  3029.             gameboard[pos + 8] = 25;
  3030.             ++attacked;
  3031.         } // end if
  3032.         if (gameboard[pos - 9] == 3 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3033.         {
  3034.             gameboard[pos - 9] = 25;
  3035.             ++attacked;
  3036.         } // end if
  3037.         if (gameboard[pos - 7] == 3 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  3038.         {
  3039.             gameboard[pos - 7] = 25;
  3040.             ++attacked;
  3041.         } // end if
  3042.         if (gameboard[pos - 8] == 3)
  3043.         {
  3044.             gameboard[pos - 8] = 25;
  3045.             ++attacked;
  3046.         } // end if
  3047.     } // end else if
  3048.     showBoard(true);
  3049.     if (_root.muted == false)
  3050.     {
  3051.         if (attacked >= 7)
  3052.         {
  3053.             sound_pass.start();
  3054.         }
  3055.         else if (attacked >= 5)
  3056.         {
  3057.             sound_attack2.start();
  3058.         }
  3059.         else if (attacked >= 3)
  3060.         {
  3061.             sound_attack.start();
  3062.         }
  3063.         else if (attacked >= 1)
  3064.         {
  3065.             sound_attack1.start();
  3066.         } // end else if
  3067.     } // end else if
  3068.     if (playersGo)
  3069.     {
  3070.         playersGo = false;
  3071.         playerHL.gotoAndStop(1);
  3072.         computerLight.gotoAndStop(2);
  3073.     }
  3074.     else
  3075.     {
  3076.         playersGo = true;
  3077.         playerHL.gotoAndStop(2);
  3078.         computerLight.gotoAndStop(1);
  3079.     } // end else if
  3080.     ++curGo;
  3081. } // End of the function
  3082. function clearClicked()
  3083. {
  3084.     for (i = 0; i < 64; i++)
  3085.     {
  3086.         if (gameboard[i] == 4 || gameboard[i] == 5)
  3087.         {
  3088.             gameboard[i] = 1;
  3089.         } // end if
  3090.     } // end of for
  3091. } // End of the function
  3092. function placeBlob(pos)
  3093. {
  3094.     if (_root.muted == false)
  3095.     {
  3096.         sound_spawn.start();
  3097.     } // end if
  3098.     if (playersGo)
  3099.     {
  3100.         gameboard[pos] = 3;
  3101.     }
  3102.     else
  3103.     {
  3104.         gameboard[pos] = 2;
  3105.     } // end else if
  3106.     clearClicked();
  3107.     showBoard(false);
  3108.     attack(pos);
  3109. } // End of the function
  3110. function moveBlob(pos)
  3111. {
  3112.     if (_root.muted == false)
  3113.     {
  3114.         sound_take.start();
  3115.     } // end if
  3116.     if (playersGo)
  3117.     {
  3118.         gameboard[pos] = 3;
  3119.     }
  3120.     else
  3121.     {
  3122.         gameboard[pos] = 2;
  3123.     } // end else if
  3124.     gameboard[selectedpos] = 1;
  3125.     clearClicked();
  3126.     showBoard(false);
  3127.     attack(pos);
  3128. } // End of the function
  3129. function blobClicked(blob, pos)
  3130. {
  3131.     if (_root.muted == false)
  3132.     {
  3133.         sound_select.start();
  3134.     } // end if
  3135.     selected = blob;
  3136.     selectedpos = pos;
  3137.     clearClicked();
  3138.     if (gameboard[pos + 1] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  3139.     {
  3140.         gameboard[pos + 1] = 4;
  3141.     } // end if
  3142.     if (gameboard[pos + 2] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3143.     {
  3144.         gameboard[pos + 2] = 5;
  3145.     } // end if
  3146.     if (gameboard[pos + 8] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63)
  3147.     {
  3148.         gameboard[pos + 8] = 4;
  3149.     } // end if
  3150.     if (gameboard[pos + 16] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63)
  3151.     {
  3152.         gameboard[pos + 16] = 5;
  3153.     } // end if
  3154.     if (gameboard[pos - 1] == 1 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3155.     {
  3156.         gameboard[pos - 1] = 4;
  3157.     } // end if
  3158.     if (gameboard[pos - 2] == 1 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3159.     {
  3160.         gameboard[pos - 2] = 5;
  3161.     } // end if
  3162.     if (gameboard[pos - 8] == 1 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7)
  3163.     {
  3164.         gameboard[pos - 8] = 4;
  3165.     } // end if
  3166.     if (gameboard[pos - 16] == 1 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7)
  3167.     {
  3168.         gameboard[pos - 16] = 5;
  3169.     } // end if
  3170.     if (gameboard[pos + 7] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48)
  3171.     {
  3172.         gameboard[pos + 7] = 4;
  3173.     } // end if
  3174.     if (gameboard[pos + 6] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3175.     {
  3176.         gameboard[pos + 6] = 5;
  3177.     } // end if
  3178.     if (gameboard[pos + 14] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3179.     {
  3180.         gameboard[pos + 14] = 5;
  3181.     } // end if
  3182.     if (gameboard[pos + 15] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48)
  3183.     {
  3184.         gameboard[pos + 15] = 5;
  3185.     } // end if
  3186.     if (gameboard[pos + 9] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55)
  3187.     {
  3188.         gameboard[pos + 9] = 4;
  3189.     } // end if
  3190.     if (gameboard[pos + 10] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3191.     {
  3192.         gameboard[pos + 10] = 5;
  3193.     } // end if
  3194.     if (gameboard[pos + 17] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55)
  3195.     {
  3196.         gameboard[pos + 17] = 5;
  3197.     } // end if
  3198.     if (gameboard[pos + 18] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3199.     {
  3200.         gameboard[pos + 18] = 5;
  3201.     } // end if
  3202.     if (gameboard[pos - 7] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6)
  3203.     {
  3204.         gameboard[pos - 7] = 4;
  3205.     } // end if
  3206.     if (gameboard[pos - 6] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3207.     {
  3208.         gameboard[pos - 6] = 5;
  3209.     } // end if
  3210.     if (gameboard[pos - 14] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3211.     {
  3212.         gameboard[pos - 14] = 5;
  3213.     } // end if
  3214.     if (gameboard[pos - 15] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6)
  3215.     {
  3216.         gameboard[pos - 15] = 5;
  3217.     } // end if
  3218.     if (gameboard[pos - 9] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3219.     {
  3220.         gameboard[pos - 9] = 4;
  3221.     } // end if
  3222.     if (gameboard[pos - 10] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3223.     {
  3224.         gameboard[pos - 10] = 5;
  3225.     } // end if
  3226.     if (gameboard[pos - 17] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3227.     {
  3228.         gameboard[pos - 17] = 5;
  3229.     } // end if
  3230.     if (gameboard[pos - 18] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3231.     {
  3232.         gameboard[pos - 18] = 5;
  3233.     } // end if
  3234.     gameboard[pos] = 45;
  3235.     showBoard(false);
  3236.     gameboard[pos] = 3;
  3237. } // End of the function
  3238. function computerClicked(blob, pos)
  3239. {
  3240.     selected = blob;
  3241.     selectedpos = pos;
  3242.     if (gameboard[pos + 1] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63)
  3243.     {
  3244.         gameboard[pos + 1] = 4;
  3245.     } // end if
  3246.     if (gameboard[pos + 2] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3247.     {
  3248.         gameboard[pos + 2] = 5;
  3249.     } // end if
  3250.     if (gameboard[pos + 8] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63)
  3251.     {
  3252.         gameboard[pos + 8] = 4;
  3253.     } // end if
  3254.     if (gameboard[pos + 16] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63)
  3255.     {
  3256.         gameboard[pos + 16] = 5;
  3257.     } // end if
  3258.     if (gameboard[pos - 1] == 1 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3259.     {
  3260.         gameboard[pos - 1] = 4;
  3261.     } // end if
  3262.     if (gameboard[pos - 2] == 1 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3263.     {
  3264.         gameboard[pos - 2] = 5;
  3265.     } // end if
  3266.     if (gameboard[pos - 8] == 1 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7)
  3267.     {
  3268.         gameboard[pos - 8] = 4;
  3269.     } // end if
  3270.     if (gameboard[pos - 16] == 1 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7)
  3271.     {
  3272.         gameboard[pos - 16] = 5;
  3273.     } // end if
  3274.     if (gameboard[pos + 7] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48)
  3275.     {
  3276.         gameboard[pos + 7] = 4;
  3277.     } // end if
  3278.     if (gameboard[pos + 6] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3279.     {
  3280.         gameboard[pos + 6] = 5;
  3281.     } // end if
  3282.     if (gameboard[pos + 14] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3283.     {
  3284.         gameboard[pos + 14] = 5;
  3285.     } // end if
  3286.     if (gameboard[pos + 15] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48)
  3287.     {
  3288.         gameboard[pos + 15] = 5;
  3289.     } // end if
  3290.     if (gameboard[pos + 9] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55)
  3291.     {
  3292.         gameboard[pos + 9] = 4;
  3293.     } // end if
  3294.     if (gameboard[pos + 10] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3295.     {
  3296.         gameboard[pos + 10] = 5;
  3297.     } // end if
  3298.     if (gameboard[pos + 17] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55)
  3299.     {
  3300.         gameboard[pos + 17] = 5;
  3301.     } // end if
  3302.     if (gameboard[pos + 18] == 1 && pos != 56 && pos != 57 && pos != 58 && pos != 59 && pos != 60 && pos != 61 && pos != 62 && pos != 63 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3303.     {
  3304.         gameboard[pos + 18] = 5;
  3305.     } // end if
  3306.     if (gameboard[pos - 7] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6)
  3307.     {
  3308.         gameboard[pos - 7] = 4;
  3309.     } // end if
  3310.     if (gameboard[pos - 6] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3311.     {
  3312.         gameboard[pos - 6] = 5;
  3313.     } // end if
  3314.     if (gameboard[pos - 14] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 6 && pos != 14 && pos != 22 && pos != 30 && pos != 38 && pos != 46 && pos != 54 && pos != 62)
  3315.     {
  3316.         gameboard[pos - 14] = 5;
  3317.     } // end if
  3318.     if (gameboard[pos - 15] == 1 && pos != 7 && pos != 15 && pos != 23 && pos != 31 && pos != 39 && pos != 47 && pos != 55 && pos != 63 && pos != 0 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6)
  3319.     {
  3320.         gameboard[pos - 15] = 5;
  3321.     } // end if
  3322.     if (gameboard[pos - 9] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3323.     {
  3324.         gameboard[pos - 9] = 4;
  3325.     } // end if
  3326.     if (gameboard[pos - 10] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3327.     {
  3328.         gameboard[pos - 10] = 5;
  3329.     } // end if
  3330.     if (gameboard[pos - 17] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56)
  3331.     {
  3332.         gameboard[pos - 17] = 5;
  3333.     } // end if
  3334.     if (gameboard[pos - 18] == 1 && pos != 1 && pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 6 && pos != 7 && pos != 0 && pos != 8 && pos != 16 && pos != 24 && pos != 32 && pos != 40 && pos != 48 && pos != 56 && pos != 1 && pos != 9 && pos != 17 && pos != 25 && pos != 33 && pos != 41 && pos != 49 && pos != 57)
  3335.     {
  3336.         gameboard[pos - 18] = 5;
  3337.     } // end if
  3338.     gameboard[pos] = 46;
  3339.     showBoard(false);
  3340.     gameboard[pos] = 2;
  3341. } // End of the function
  3342. function makeBoard()
  3343. {
  3344.     var row;
  3345.     var col;
  3346.     var name;
  3347.     var count = 1;
  3348.     counter = 0;
  3349.     for (row = 0; row < 8; row++)
  3350.     {
  3351.         for (col = 0; col < 8; col++)
  3352.         {
  3353.             name = "board" + row + "_" + col;
  3354.             duplicateMovieClip("piece", name, count++);
  3355.             eval(name).row = row;
  3356.             eval(name).col = col;
  3357.             eval(name).name = name;
  3358.             eval(name).pos = counter;
  3359.             ++counter;
  3360.         } // end of for
  3361.     } // end of for
  3362.     board0_0._x = 241.600000;
  3363.     board0_0._y = 42.900000;
  3364.     board0_1._x = 275.200000;
  3365.     board0_1._y = 58.500000;
  3366.     board0_2._x = 308.900000;
  3367.     board0_2._y = 74.200000;
  3368.     board0_3._x = 342.500000;
  3369.     board0_3._y = 89.800000;
  3370.     board0_4._x = 376.100000;
  3371.     board0_4._y = 105.400000;
  3372.     board0_5._x = 409.800000;
  3373.     board0_5._y = 121.200000;
  3374.     board0_6._x = 443.400000;
  3375.     board0_6._y = 136.700000;
  3376.     board0_7._x = 477;
  3377.     board0_7._y = 152.300000;
  3378.     board1_0._x = 207.900000;
  3379.     board1_0._y = 58.800000;
  3380.     board1_1._x = 241.600000;
  3381.     board1_1._y = 74.200000;
  3382.     board1_2._x = 275.200000;
  3383.     board1_2._y = 89.800000;
  3384.     board1_3._x = 308.900000;
  3385.     board1_3._y = 105.200000;
  3386.     board1_4._x = 342.500000;
  3387.     board1_4._y = 121.100000;
  3388.     board1_5._x = 376.100000;
  3389.     board1_5._y = 136.700000;
  3390.     board1_6._x = 409.800000;
  3391.     board1_6._y = 152.300000;
  3392.     board1_7._x = 443.400000;
  3393.     board1_7._y = 167.900000;
  3394.     board2_0._x = 174.300000;
  3395.     board2_0._y = 74.200000;
  3396.     board2_1._x = 207.900000;
  3397.     board2_1._y = 89.800000;
  3398.     board2_2._x = 241.600000;
  3399.     board2_2._y = 105.400000;
  3400.     board2_3._x = 275.200000;
  3401.     board2_3._y = 121.100000;
  3402.     board2_4._x = 308.900000;
  3403.     board2_4._y = 136.700000;
  3404.     board2_5._x = 342.500000;
  3405.     board2_5._y = 152.300000;
  3406.     board2_6._x = 376.100000;
  3407.     board2_6._y = 167.900000;
  3408.     board2_7._x = 409.800000;
  3409.     board2_7._y = 183.600000;
  3410.     board3_0._x = 140.700000;
  3411.     board3_0._y = 89.900000;
  3412.     board3_1._x = 174.300000;
  3413.     board3_1._y = 105.400000;
  3414.     board3_2._x = 207.900000;
  3415.     board3_2._y = 121.100000;
  3416.     board3_3._x = 241.600000;
  3417.     board3_3._y = 136.700000;
  3418.     board3_4._x = 275.200000;
  3419.     board3_4._y = 152.300000;
  3420.     board3_5._x = 308.900000;
  3421.     board3_5._y = 167.900000;
  3422.     board3_6._x = 342.500000;
  3423.     board3_6._y = 183.600000;
  3424.     board3_7._x = 376.100000;
  3425.     board3_7._y = 199.200000;
  3426.     board4_0._x = 107.100000;
  3427.     board4_0._y = 105.400000;
  3428.     board4_1._x = 140.700000;
  3429.     board4_1._y = 121.100000;
  3430.     board4_2._x = 174.300000;
  3431.     board4_2._y = 136.700000;
  3432.     board4_3._x = 207.900000;
  3433.     board4_3._y = 152.300000;
  3434.     board4_4._x = 241.600000;
  3435.     board4_4._y = 167.900000;
  3436.     board4_5._x = 275.200000;
  3437.     board4_5._y = 183.600000;
  3438.     board4_6._x = 308.900000;
  3439.     board4_6._y = 199.200000;
  3440.     board4_7._x = 342.500000;
  3441.     board4_7._y = 214.800000;
  3442.     board5_0._x = 73.400000;
  3443.     board5_0._y = 121.100000;
  3444.     board5_1._x = 107.100000;
  3445.     board5_1._y = 136.700000;
  3446.     board5_2._x = 140.700000;
  3447.     board5_2._y = 152.300000;
  3448.     board5_3._x = 174.300000;
  3449.     board5_3._y = 167.900000;
  3450.     board5_4._x = 208;
  3451.     board5_4._y = 183.600000;
  3452.     board5_5._x = 241.600000;
  3453.     board5_5._y = 199.200000;
  3454.     board5_6._x = 275.200000;
  3455.     board5_6._y = 214.800000;
  3456.     board5_7._x = 308.900000;
  3457.     board5_7._y = 230.400000;
  3458.     board6_0._x = 39.800000;
  3459.     board6_0._y = 136.700000;
  3460.     board6_1._x = 73.400000;
  3461.     board6_1._y = 152.300000;
  3462.     board6_2._x = 107.100000;
  3463.     board6_2._y = 167.900000;
  3464.     board6_3._x = 140.700000;
  3465.     board6_3._y = 183.600000;
  3466.     board6_4._x = 174.300000;
  3467.     board6_4._y = 199.200000;
  3468.     board6_5._x = 207.900000;
  3469.     board6_5._y = 214.800000;
  3470.     board6_6._x = 242;
  3471.     board6_6._y = 230.400000;
  3472.     board6_7._x = 275.200000;
  3473.     board6_7._y = 246.100000;
  3474.     board7_0._x = 6.300000;
  3475.     board7_0._y = 152.300000;
  3476.     board7_1._x = 39.800000;
  3477.     board7_1._y = 167.900000;
  3478.     board7_2._x = 73.400000;
  3479.     board7_2._y = 183.600000;
  3480.     board7_3._x = 107.100000;
  3481.     board7_3._y = 199.200000;
  3482.     board7_4._x = 140.700000;
  3483.     board7_4._y = 214.800000;
  3484.     board7_5._x = 174.300000;
  3485.     board7_5._y = 230.400000;
  3486.     board7_6._x = 207.900000;
  3487.     board7_6._y = 246.300000;
  3488.     board7_7._x = 241.600000;
  3489.     board7_7._y = 261.800000;
  3490.     for (row = 0; row < 8; row++)
  3491.     {
  3492.         for (col = 0; col < 8; col++)
  3493.         {
  3494.             name = "board" + row + "_" + col;
  3495.             eval(name)._x = eval(name)._x + 34;
  3496.             eval(name)._y = eval(name)._y + 40;
  3497.         } // end of for
  3498.     } // end of for
  3499.     duplicateMovieClip("message", "popup", count++);
  3500.     duplicateMovieClip("message", "popup2", count++);
  3501.     popup._x = 275;
  3502.     popup._y = 200;
  3503.     popup2._x = 275;
  3504.     popup2._y = 200;
  3505. } // End of the function
  3506. function initGame()
  3507. {
  3508.     var row;
  3509.     var col;
  3510.     var name;
  3511.     var count = 1;
  3512.     for (i = 0; i < 100; i++)
  3513.     {
  3514.         gameboard[i] = 1;
  3515.         compboard1[i] = 0;
  3516.         compboard2[i] = 0;
  3517.         compboard3[i] = 0;
  3518.     } // end of for
  3519.     gameboard[0] = 3;
  3520.     gameboard[56] = 3;
  3521.     gameboard[7] = 2;
  3522.     gameboard[63] = 2;
  3523.     if (arena == 4)
  3524.     {
  3525.         gameboard[27] = 65;
  3526.         gameboard[28] = 65;
  3527.         gameboard[35] = 65;
  3528.         gameboard[36] = 65;
  3529.         gameboard[18] = 65;
  3530.         gameboard[21] = 65;
  3531.         gameboard[42] = 65;
  3532.         gameboard[45] = 65;
  3533.     }
  3534.     else if (arena == 2)
  3535.     {
  3536.         gameboard[1] = 65;
  3537.         gameboard[8] = 65;
  3538.         gameboard[6] = 65;
  3539.         gameboard[15] = 65;
  3540.         gameboard[48] = 65;
  3541.         gameboard[57] = 65;
  3542.         gameboard[55] = 65;
  3543.         gameboard[62] = 65;
  3544.     }
  3545.     else if (arena == 6)
  3546.     {
  3547.         gameboard[27] = 65;
  3548.         gameboard[28] = 65;
  3549.         gameboard[35] = 65;
  3550.         gameboard[36] = 65;
  3551.         gameboard[18] = 65;
  3552.         gameboard[21] = 65;
  3553.         gameboard[42] = 65;
  3554.         gameboard[45] = 65;
  3555.         gameboard[9] = 65;
  3556.         gameboard[14] = 65;
  3557.         gameboard[49] = 65;
  3558.         gameboard[54] = 65;
  3559.     }
  3560.     else if (arena == 5)
  3561.     {
  3562.         gameboard[19] = 65;
  3563.         gameboard[20] = 65;
  3564.         gameboard[26] = 65;
  3565.         gameboard[34] = 65;
  3566.         gameboard[29] = 65;
  3567.         gameboard[37] = 65;
  3568.         gameboard[43] = 65;
  3569.         gameboard[44] = 65;
  3570.         gameboard[9] = 65;
  3571.         gameboard[14] = 65;
  3572.         gameboard[49] = 65;
  3573.         gameboard[54] = 65;
  3574.     }
  3575.     else if (arena == 3)
  3576.     {
  3577.         gameboard[2] = 65;
  3578.         gameboard[10] = 65;
  3579.         gameboard[5] = 65;
  3580.         gameboard[13] = 65;
  3581.         gameboard[16] = 65;
  3582.         gameboard[17] = 65;
  3583.         gameboard[22] = 65;
  3584.         gameboard[23] = 65;
  3585.         gameboard[50] = 65;
  3586.         gameboard[58] = 65;
  3587.         gameboard[53] = 65;
  3588.         gameboard[61] = 65;
  3589.         gameboard[40] = 65;
  3590.         gameboard[41] = 65;
  3591.         gameboard[46] = 65;
  3592.         gameboard[47] = 65;
  3593.     } // end else if
  3594.     curGo = 0;
  3595.     playerHL.gotoAndStop(2);
  3596.     showBoard();
  3597. } // End of the function
  3598. function showBoard(animate)
  3599. {
  3600.     bluecount = 0;
  3601.     redcount = 0;
  3602.     for (i = 11; i < 19; i++)
  3603.     {
  3604.         j = i - 11;
  3605.         name = "board0_" + j;
  3606.         if ((gameboard[i - 11] == 6 || gameboard[i - 11] == 25 || gameboard[i - 11] == 13 || gameboard[i - 11] == 32) && animate)
  3607.         {
  3608.             eval(name).gotoAndPlay(gameboard[i - 11]);
  3609.             if (playersGo)
  3610.             {
  3611.                 gameboard[i - 11] = 3;
  3612.             }
  3613.             else
  3614.             {
  3615.                 gameboard[i - 11] = 2;
  3616.             } // end else if
  3617.             continue;
  3618.         } // end if
  3619.         eval(name).gotoAndStop(gameboard[i - 11]);
  3620.     } // end of for
  3621.     for (i = 21; i < 29; i++)
  3622.     {
  3623.         j = i - 21;
  3624.         name = "board1_" + j;
  3625.         if ((gameboard[i - 13] == 6 || gameboard[i - 13] == 25 || gameboard[i - 13] == 13 || gameboard[i - 13] == 32) && animate)
  3626.         {
  3627.             eval(name).gotoAndPlay(gameboard[i - 13]);
  3628.             if (playersGo)
  3629.             {
  3630.                 gameboard[i - 13] = 3;
  3631.             }
  3632.             else
  3633.             {
  3634.                 gameboard[i - 13] = 2;
  3635.             } // end else if
  3636.             continue;
  3637.         } // end if
  3638.         eval(name).gotoAndStop(gameboard[i - 13]);
  3639.     } // end of for
  3640.     for (i = 31; i < 39; i++)
  3641.     {
  3642.         j = i - 31;
  3643.         name = "board2_" + j;
  3644.         if ((gameboard[i - 15] == 6 || gameboard[i - 15] == 25 || gameboard[i - 15] == 13 || gameboard[i - 15] == 32) && animate)
  3645.         {
  3646.             eval(name).gotoAndPlay(gameboard[i - 15]);
  3647.             if (playersGo)
  3648.             {
  3649.                 gameboard[i - 15] = 3;
  3650.             }
  3651.             else
  3652.             {
  3653.                 gameboard[i - 15] = 2;
  3654.             } // end else if
  3655.             continue;
  3656.         } // end if
  3657.         eval(name).gotoAndStop(gameboard[i - 15]);
  3658.     } // end of for
  3659.     for (i = 41; i < 49; i++)
  3660.     {
  3661.         j = i - 41;
  3662.         name = "board3_" + j;
  3663.         if ((gameboard[i - 17] == 6 || gameboard[i - 17] == 25 || gameboard[i - 17] == 13 || gameboard[i - 17] == 32) && animate)
  3664.         {
  3665.             eval(name).gotoAndPlay(gameboard[i - 17]);
  3666.             if (playersGo)
  3667.             {
  3668.                 gameboard[i - 17] = 3;
  3669.             }
  3670.             else
  3671.             {
  3672.                 gameboard[i - 17] = 2;
  3673.             } // end else if
  3674.             continue;
  3675.         } // end if
  3676.         eval(name).gotoAndStop(gameboard[i - 17]);
  3677.     } // end of for
  3678.     for (i = 51; i < 59; i++)
  3679.     {
  3680.         j = i - 51;
  3681.         name = "board4_" + j;
  3682.         if ((gameboard[i - 19] == 6 || gameboard[i - 19] == 25 || gameboard[i - 19] == 13 || gameboard[i - 19] == 32) && animate)
  3683.         {
  3684.             eval(name).gotoAndPlay(gameboard[i - 19]);
  3685.             if (playersGo)
  3686.             {
  3687.                 gameboard[i - 19] = 3;
  3688.             }
  3689.             else
  3690.             {
  3691.                 gameboard[i - 19] = 2;
  3692.             } // end else if
  3693.             continue;
  3694.         } // end if
  3695.         eval(name).gotoAndStop(gameboard[i - 19]);
  3696.     } // end of for
  3697.     for (i = 61; i < 69; i++)
  3698.     {
  3699.         j = i - 61;
  3700.         name = "board5_" + j;
  3701.         if ((gameboard[i - 21] == 6 || gameboard[i - 21] == 25 || gameboard[i - 21] == 13 || gameboard[i - 21] == 32) && animate)
  3702.         {
  3703.             eval(name).gotoAndPlay(gameboard[i - 21]);
  3704.             if (playersGo)
  3705.             {
  3706.                 gameboard[i - 21] = 3;
  3707.             }
  3708.             else
  3709.             {
  3710.                 gameboard[i - 21] = 2;
  3711.             } // end else if
  3712.             continue;
  3713.         } // end if
  3714.         eval(name).gotoAndStop(gameboard[i - 21]);
  3715.     } // end of for
  3716.     for (i = 71; i < 79; i++)
  3717.     {
  3718.         j = i - 71;
  3719.         name = "board6_" + j;
  3720.         if ((gameboard[i - 23] == 6 || gameboard[i - 23] == 25 || gameboard[i - 23] == 13 || gameboard[i - 23] == 32) && animate)
  3721.         {
  3722.             eval(name).gotoAndPlay(gameboard[i - 23]);
  3723.             if (playersGo)
  3724.             {
  3725.                 gameboard[i - 23] = 3;
  3726.             }
  3727.             else
  3728.             {
  3729.                 gameboard[i - 23] = 2;
  3730.             } // end else if
  3731.             continue;
  3732.         } // end if
  3733.         eval(name).gotoAndStop(gameboard[i - 23]);
  3734.     } // end of for
  3735.     for (i = 81; i < 89; i++)
  3736.     {
  3737.         j = i - 81;
  3738.         name = "board7_" + j;
  3739.         if ((gameboard[i - 25] == 6 || gameboard[i - 25] == 25 || gameboard[i - 25] == 13 || gameboard[i - 25] == 32) && animate)
  3740.         {
  3741.             eval(name).gotoAndPlay(gameboard[i - 25]);
  3742.             if (playersGo)
  3743.             {
  3744.                 gameboard[i - 25] = 3;
  3745.             }
  3746.             else
  3747.             {
  3748.                 gameboard[i - 25] = 2;
  3749.             } // end else if
  3750.             continue;
  3751.         } // end if
  3752.         eval(name).gotoAndStop(gameboard[i - 25]);
  3753.     } // end of for
  3754.     updateScores();
  3755. } // End of the function
  3756. function updateScores()
  3757. {
  3758.     redcount = 0;
  3759.     bluecount = 0;
  3760.     for (i = 0; i < 64; i++)
  3761.     {
  3762.         if (gameboard[i] == 2 || gameboard[i] == 46)
  3763.         {
  3764.             ++redcount;
  3765.             continue;
  3766.         } // end if
  3767.         if (gameboard[i] == 3 || gameboard[i] == 45)
  3768.         {
  3769.             ++bluecount;
  3770.         } // end if
  3771.     } // end of for
  3772.     blues = bluecount;
  3773.     reds = redcount;
  3774.     if (redcount + bluecount == numTiles || redcount == 0 || bluecount == 0)
  3775.     {
  3776.         endGame(redcount, bluecount);
  3777.     } // end if
  3778. } // End of the function
  3779. function removeMovedBlob()
  3780. {
  3781.     trace ("remove " + blobToRemove);
  3782.     if (playersGo)
  3783.     {
  3784.         eval(blobToRemove).gotoAndPlay(50);
  3785.     }
  3786.     else
  3787.     {
  3788.         eval(blobToRemove).gotoAndPlay(57);
  3789.     } // end else if
  3790. } // End of the function
  3791. function updateBlob(piece, frame)
  3792. {
  3793.     eval(piece).gotoAndPlay(frame);
  3794. } // End of the function
  3795. function endGame()
  3796. {
  3797.     trace ("endgame");
  3798.     if (reds == bluecount)
  3799.     {
  3800.         popup2.gotoAndPlay(95);
  3801.         trace ("draw");
  3802.     }
  3803.     else if (reds > blues)
  3804.     {
  3805.         popup2.gotoAndPlay(180);
  3806.         trace ("red");
  3807.     }
  3808.     else if (blues > reds)
  3809.     {
  3810.         popup2.gotoAndPlay(263);
  3811.         trace ("blue");
  3812.     }
  3813.     else
  3814.     {
  3815.         trace ("no win");
  3816.     } // end else if
  3817.     trace (gameboard);
  3818. } // End of the function
  3819. function removePieces()
  3820. {
  3821.     var row;
  3822.     var col;
  3823.     var name;
  3824.     var count = 1;
  3825.     counter = 0;
  3826.     for (row = 0; row < 8; row++)
  3827.     {
  3828.         for (col = 0; col < 8; col++)
  3829.         {
  3830.             name = "board" + row + "_" + col;
  3831.             removeMovieClip (name);
  3832.             ++counter;
  3833.         } // end of for
  3834.     } // end of for
  3835. } // End of the function
  3836. function nextRound()
  3837. {
  3838.     popup.gotoAndStop(1);
  3839.     gotoAndPlay(189);
  3840.     trace ("bluewon");
  3841. } // End of the function
  3842. function gameOver()
  3843. {
  3844.     gotoAndPlay(193);
  3845. } // End of the function
  3846. sound_drums.start(0, 999);
  3847. ++numGames;
  3848. bestmove = 0;
  3849. bestblob = 0;
  3850. PLAYER = 3;
  3851. COMPUTER = 2;
  3852. OFFBOARD = 4;
  3853. jumpMove = false;
  3854. blobToRemove = 0;
  3855. selected = 0;
  3856. selectedpos = 0;
  3857. playersGo = true;
  3858. flip = new Array(8);
  3859. gameboard = new Array(100);
  3860. compboard1 = new Array(100);
  3861. compboard2 = new Array(100);
  3862. compboard3 = new Array(100);
  3863. compFull = new Array();
  3864. compFull2 = new Array();
  3865. board = new Array(64);
  3866. cBoard = new Array(64);
  3867. pBoard = new Array(64);
  3868. makeBoard();
  3869. initGame();
  3870. trace ("-------------------------------------");
  3871. debugShowBoard();
  3872. stop ();
  3873.  
  3874. // [Action in Frame 192]
  3875. gotoAndStop(191);
  3876.  
  3877. // [Action in Frame 193]
  3878. if (_root.muted == false)
  3879. {
  3880.     _root.sound_laugh.start();
  3881. } // end if
  3882. sound_drums.stop();
  3883.  
  3884. stop ();
  3885.  
  3886. // [Action in Frame 194]
  3887. loadMovie("http://www.kwikgames.com/adverts/blobwars_ad.swf", _root.promo);
  3888. sound_drums.stop();
  3889.  
  3890. // [Action in Frame 292]
  3891. stop ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement