daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         for(increment_y;increment_y<=table_y.len;increment_y++) //Find mines around empty squares
  2.             for(increment_x;increment_x<=table_x.len;increment_x++)
  3.                 if(table_x[increment_x]!=0) //If not a mine, start looking for mines around!
  4.                     static_increment_y = increment_y
  5.                     var/square_value = 0
  6.                     for(increment_y=static_increment_y-1;increment_y<=static_increment_y+2;increment_y++)   //Go one row above then go to the same row as square, then 1 row below
  7.                         if(table_y.len < increment_y || increment_y < 1)    //If outside the board desired, don't check
  8.                             continue
  9.                         else
  10.                             static_increment_x = increment_x
  11.                             for(increment_x=static_increment_x-1;increment_x<=static_increment_x+2;increment_x++)   //Look in the 3 squares touching our selected one, in the respective row
  12.                                 if(table_x.len < increment_x || increment_x < 1)
  13.                                     continue
  14.                                 else
  15.                                     if(table_x[increment_x] == 0)
  16.                                         square_value += 1
  17.                     table_x[increment_x] = square_value //Change square's value to original square value value plus 1 for every mine around it
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top