- The game
Given an N by N square array of zeroes or ones in an initial configuration, and a target configuration of zeroes and ones The task is to transform one to the other in as few moves as possible by inverting whole numbered rows or whole lettered columns at once, as one move.
In an inversion any 1 becomes 0, and any 0 becomes 1 for that whole row or column.
- The Task
The task is to create a program to score for the Flipping bits game.
- The game should create an original random target configuration and a starting configuration.
- Ensure that the starting position is never the target position.
- The target position must be guaranteed as reachable from the starting position. (One possible way to do this is to generate the start position by legal flips from a random target position. The flips will always be reversible back to the target from the given start position).
- The number of moves taken so far should be shown.
Show an example of a short game here, on this page, for a 3 by 3 array of bits.
TARGET: 1 2 3 a 0 1 0 b 0 1 0 c 0 1 0 YOU: 1 2 3 a 0 0 0 b 0 0 0 c 1 1 1 Enter rows letters and/or column numbers: 2c ** Well done! ** Used 2 moves.
Content is available under GNU Free Documentation License 1.2.