Flipping bits game: Difference between revisions

m
→‎{{header|REXX}}: changed section header comments, changed column identifiers to be more idiomatic.
m (→‎{{header|REXX}}: expanded program logic to allow a 26x26 grid array.)
m (→‎{{header|REXX}}: changed section header comments, changed column identifiers to be more idiomatic.)
Line 1,723:
=={{header|REXX}}==
This REXX version allows the specification (on the invocation line) for:
:::*   the size of the array (grid)   [default is 3,   maximum is 26]
:::*   the number of bits (for the target) to be set to   '''on'''   [default is size of the grid]
:::*   the characters which are used for the   '''on'''   and   '''off'''   (bits)   [defaults are   '''1'''   and   '''0''']
<lang rexx>/*REXX program presents a "flipping bit" puzzle, user can solve via C.L.*/
parse arg N u on off . /*get optional arguments. */
Line 1,732:
if on =='' then on =1 /*character used for "on". */
if off=='' then off=0 /*character used for "off". */
cols='ABCDEFGHIJKLMNOPQRSTUVWXYZ' /*letters to be used for columns.*/
col@='a b c d e f g h i j k l m n o p q r s t u v w x y z' /*for col id.*/
cols='ABCDEFGHIJKLMNOPQRSTUVWXYZ'space(col@,0); upper cols /*letters to be used for columns.*/
@.=off; !.=off /*set both arrays to "off" chars.*/
tries=0 /*# of player's attempts used. */