Flipping bits game: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added a seed (for the RANDOM function) to make the game repeatable.)
(Added Julia output)
Line 1,778: Line 1,778:
Completed in 3 moves.</pre>
Completed in 3 moves.</pre>


=={{header|Julia}}=={{output?|Julia}}
=={{header|Julia}}==
{{works with|Julia|0.6}}
{{works with|Julia|0.6}}


Line 1,878: Line 1,878:


end # module FlippingBitsGame</lang>
end # module FlippingBitsGame</lang>

{{output}}
<pre>Insert the size of the matrix (nrow [> 1] *space* ncol [> 1]):3 3

0 flips until now.
Current configuration:
1 2 3
---------
1 | F F F
2 | T F T
3 | F F T

Objective configuration:
1 2 3
---------
1 | F F T
2 | F T T
3 | F F F

Insert R[ind] to flip row, C[ind] to flip a column, Q to quit: c3

1 flips until now.
Current configuration:
1 2 3
---------
1 | F F T
2 | T F F
3 | F F F

Objective configuration:
1 2 3
---------
1 | F F T
2 | F T T
3 | F F F

Insert R[ind] to flip row, C[ind] to flip a column, Q to quit: r2

SUCCED! In 2 flips.
1 2 3
---------
1 | F F T
2 | F T T
3 | F F F
</pre>


=={{header|Kotlin}}==
=={{header|Kotlin}}==