Advertisement
Sorceress

Untitled

May 7th, 2016
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. p=0;
  2. for( x = 0; x < gridMax; x++ ){
  3. for( y = 0; y < gridMax; y++ ){
  4. if(x+1 < gridMax && grid[x,y].RoomHere != grid[x+1,y].RoomHere) p++;
  5. if(y+1 < gridMax && grid[x,y].RoomHere != grid[x,y+1].RoomHere) p++;
  6. }
  7. }
  8.  
  9. //p holds the perimeter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement