a guest Feb 16th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- for(increment_y;increment_y<=table_y.len;increment_y++) //Find mines around empty squares
- if(table_x[increment_x]!=0) //If not a mine, start looking for mines around!
- static_increment_y = increment_y
- var/square_value = 0
- 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
- if(table_y.len < increment_y || increment_y < 1) //If outside the board desired, don't check
- static_increment_x = increment_x
- 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
- if(table_x.len < increment_x || increment_x < 1)
- if(table_x[increment_x] == 0)
- square_value += 1
- 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