Square edge room selection Code works for any N greater than 1. Visual representation works for N > 1, as long as the output fits in the screen. Visual representation of how the count_rooms loop runs: Note how the the corners are processed :)