Peter and Bob play a game on a $n\times n$ chessboard. At the beginning, all squares are white apart from one black corner square containing a rook. Players take turns to move the rook to a white square and recolour the square black.  The player who can not move loses. Peter goes first. Who has a winning strategy?
1. **Initial Setup and Definitions**:
   - Consider an \( n \times n \) chessboard.
   - Initially, all squares are white except for one black corner square containing a rook.
   - Players take turns moving the rook to a white square and recoloring that square black.
   - The player who cannot move loses.
   - Peter goes first.

2. **Strategy for Even \( n \)**:
   - If \( n \) is even, Peter can use a strategy based on dividing the board into \( 1 \times 2 \) rectangles.
   - Peter's strategy:
     - Divide the board into \( \frac{n}{2} \times n \) strips of \( 1 \times 2 \) rectangles.
     - Whenever the rook enters a rectangle, Peter moves it to the other cell within the same rectangle.
     - This ensures that Peter always has a move as long as there are white squares left.
   - Since Peter can always respond to Bob's moves within the same \( 1 \times 2 \) rectangle, Peter will always have a move until the board is fully black.

3. **Strategy for Odd \( n \)**:
   - If \( n \) is odd, Bob can use a similar strategy after Peter's first move.
   - Bob's strategy:
     - After Peter's first move, Bob divides the remaining board (excluding the starting cell) into \( 1 \times 2 \) rectangles.
     - Bob then employs the same strategy as Peter, moving the rook within the \( 1 \times 2 \) rectangles.
     - This ensures that Bob always has a move as long as there are white squares left.
   - Since Bob can always respond to Peter's moves within the same \( 1 \times 2 \) rectangle, Bob will always have a move until the board is fully black.

4. **Conclusion**:
   - Peter wins if \( n \) is even because he can always ensure a move by using the \( 1 \times 2 \) rectangle strategy.
   - Bob wins if \( n \) is odd because he can use the same strategy after Peter's first move.

The final answer is Peter wins if \( \boxed{ n } \) is even, and Bob wins if \( n \) is odd.