Untitled

By Cobalt Tortoise, 11 Years ago, written in Plain Text, viewed 627 times.
URL http://pb.stoleyour.com/view/af6e0be4 Embed
Download Paste or View RawExpand paste to full width of browser
  1.  
  2.                
  3.                 /*************************************************
  4.                  *                        Analyze Attacks
  5.                  ************************************************/
  6.                
  7.                 int[][] pawns = color ? pawnsW : pawnsB;
  8.                
  9.                 for (int i=0;i<pawns.length;i++){
  10.                         int[] position = {pawns[i][0], pawns[i][1] + offsetY}; // Analyze Y+1
  11.                         // Verifying attack at -1 on x-axis
  12.                         position[0] = position[0] - 1;
  13.                         if (position[0] >= 0 && position[0] <= 7 && position[1] >= 0 && position[1] <= 7){
  14.                                 if (Bitsmagic.isPawnAt(position, boardEnemy)){
  15.                                         score = score + VALUE_ATTACK;
  16.                                        
  17.                                         /*************************************************
  18.                                          *                  Analyze Defences V2.0
  19.                                          ************************************************/
  20.                                         int[] position2 = {pawns[i][0], pawns[i][1] - offsetY}; // Analyze Y-1
  21.                                        
  22.                                         // Verifying defence at -1 on x-axis
  23.                                         position2[0] = position2[0] - 1;
  24.                                         if (position2[0] >= 0 && position2[0] <= 7 && position2[1] >= 0 && position2[1] <= 7){
  25.                                                 if (Bitsmagic.isPawnAt(position2, board)){
  26.                                                         score = score + VALUE_DEFENCE;
  27.                                                 }
  28.                                         }
  29.                                         // Verifying defence at +1 on x-axis
  30.                                         position2[0] = position2[0] + 2;
  31.                                         if (position2[0] >= 0 && position2[0] <= 7 && position2[1] >= 0 && position2[1] <= 7){
  32.                                                 if (Bitsmagic.isPawnAt(position2, board)){
  33.                                                         score = score + VALUE_DEFENCE;
  34.                                                 }
  35.                                         }
  36.                                 }
  37.                         }
  38.                         // Verifying attack at +1 on x-axis
  39.                         position[0] = position[0] + 2;
  40.                         if (position[0] >= 0 && position[0] <= 7 && position[1] >= 0 && position[1] <= 7){
  41.                                 if (Bitsmagic.isPawnAt(position, boardEnemy)){
  42.                                         score = score + VALUE_ATTACK;
  43.                                        
  44.                                         /*************************************************
  45.                                          *                  Analyze Defences V2.0
  46.                                          ************************************************/
  47.                                         int[] position3 = {pawns[i][0], pawns[i][1] - offsetY}; // Analyze Y-1
  48.                                        
  49.                                         // Verifying defence at -1 on x-axis
  50.                                         position3[0] = position3[0] - 1;
  51.                                         if (position3[0] >= 0 && position3[0] <= 7 && position3[1] >= 0 && position3[1] <= 7){
  52.                                                 if (Bitsmagic.isPawnAt(position3, board)){
  53.                                                         score = score + VALUE_DEFENCE;
  54.                                                 }
  55.                                         }
  56.                                         // Verifying defence at +1 on x-axis
  57.                                         position3[0] = position3[0] + 2;
  58.                                         if (position3[0] >= 0 && position3[0] <= 7 && position3[1] >= 0 && position3[1] <= 7){
  59.                                                 if (Bitsmagic.isPawnAt(position3, board)){
  60.                                                         score = score + VALUE_DEFENCE;
  61.                                                 }
  62.                                         }
  63.                                 }
  64.                         }
  65.                 }
  66.                
  67.                

Reply to "Untitled"

Here you can reply to the paste above