Number reversal game: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added/changed comments and whitespace, used a template for the OUTPUTs.)
m (→‎{{header|REXX}}: changed a comment.)
Line 2,856: Line 2,856:
$= /* ◄─── decimal target to be generated.*/
$= /* ◄─── decimal target to be generated.*/
do until length($)==9; _=random(1, 9) /*build a random unique numeric string.*/
do until length($)==9; _=random(1, 9) /*build a random unique numeric string.*/
if pos(_, $) \== 0 then iterate /*Unique? Only use a decimal digit once*/
if pos(_, $) \== 0 then iterate /*¬ unique? Only use a decimal dig once*/
$=$ || _ /*construct a string of unique digits. */
$=$ || _ /*construct a string of unique digits. */
if $==ok then $= /*string can't be in order, start over.*/
if $==ok then $= /*string can't be in order, start over.*/