Flipping bits game: Difference between revisions
Content added Content deleted
(Deleted a comment in Maple) |
m (added whitespace before the TOC (table of contents), added a ;Task: (bold) header.) |
||
Line 1: | Line 1: | ||
{{task}} |
{{task}} |
||
[[Category:Games]] |
|||
;The game: |
;The game: |
||
Given an N by N square array of zeroes or ones in an initial |
Given an N by N square array of zeroes or ones in an initial |
||
Line 10: | Line 12: | ||
whole row or column. |
whole row or column. |
||
; |
;Task: |
||
Create a program to score for the Flipping bits game. |
|||
# The game should create an original random target configuration and a starting configuration. |
# The game should create an original random target configuration and a starting configuration. |
||
# Ensure that the starting position is ''never'' the target position. |
# 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 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. |
# The number of moves taken so far should be shown. |
||
<br> |
|||
Show an example of a short game here, on this page, for a 3 by 3 array of bits. |
Show an example of a short game here, on this page, for a 3 by 3 array of bits. |
||
<br><br> |
|||
=={{header|Ada}}== |
=={{header|Ada}}== |