Sudoku/REXX: Difference between revisions
→REXX version 3
m (moved the HELp file to it's own page.) |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 1:
{{collection|Sudoku}}
==
=== REXX version 1 ===
This is the
This REXX program was originally written to assist in sudoku puzzle solving (by giving strong hints), and not to solve the puzzle outright.
Line 11 ⟶ 10:
<br>and to partially solve the puzzle using distinct strategies (separately or in combination). One option is to solve the puzzle.
The help for the
The
The
The
The
Some older REXXes don't have a '''changestr''' BIF, so one is included here
REXX programs
<syntaxhighlight lang="rexx">
trace off
parse arg !
Line 829:
syntax: !sigl=sigl; call er 13,!fid(2) !fid(3) !sigl !cal() condition('D') sourceline(!sigl)
tem: parse arg r,c,w; if tellInvalid then say '***error!*** row' r", col" c '('@.r.c") is a duplicate of another in the same" w'.'; return 0
tg: arg tg; if simple then tg=simple(tg); call $t gridindent || tg; return</
Line 958:
=== REXX version 2 ===
{{trans|PL/I
<
Select
When g.0fid='?' Then Do
Line 1,169:
Return
exit: Say '*ERROR*' arg(1)
</syntaxhighlight>
{{out}}
<pre>input from d:\_sudoku\in\sdk001.in
Line 1,195 ⟶ 1,197:
8 4 1 2 6 9 7 5 3
2 5 3 7 1 4 9 8 6
9 7 6 3 5 8 1 2 4
</pre>
=== REXX version 3 ===
This is version 1 (thanks) cut to the essentials, restructured, and modified
<syntaxhighlight lang="rexx">
* program to solve nearly every SUDOKU puzzle
* using a number of strategies learned from REXX version 1
Line 2,201 ⟶ 2,205:
Nop
End
Exit 12
</syntaxhighlight>
{{out}}
<pre>
|