Sudoku: Difference between revisions
Content deleted Content added
→{{header|Python}}: Link to GPL'd solvers. |
added Ursala |
||
Line 435: | Line 435: | ||
::RuleOnlyChoice solved ::sudoku at 0,1 for 2 |
::RuleOnlyChoice solved ::sudoku at 0,1 for 2 |
||
Finished solving!</pre> |
Finished solving!</pre> |
||
=={{header|Ursala}}== |
|||
<lang Ursala> |
|||
#import std |
|||
#import nat |
|||
sudoku = |
|||
@FL mat0+ block3+ mat` *+ block3*+ block9+ -+ |
|||
~&rSL+ (psort (nleq+)* <~&blrl,~&blrr>)+ ~&arg^& -+ |
|||
~&al?\~&ar ~&aa^&~&afahPRPfafatPJPRY+ ~&farlthlriNCSPDPDrlCS2DlrTS2J, |
|||
^|J/~& ~&rt!=+ ^= ~&s+ ~&H( |
|||
-+.|=&lrr;,|=&lrl;,|=≪+-, |
|||
~&rgg&& ~&irtPFXlrjrXPS; ~&lrK2tkZ2g&& ~&llrSL2rDrlPrrPljXSPTSL)+-, |
|||
//~&p ^|DlrDSLlrlPXrrPDSL(~&,num*+ rep2 block3)*= num block27 ~&iiK0 iota9, |
|||
* `0?=\~&iNC ! ~&t digits+- |
|||
</lang> |
|||
test program: |
|||
<lang Ursala> |
|||
#show+ |
|||
example = |
|||
sudoku |
|||
-[ |
|||
394002670 |
|||
000300400 |
|||
500690020 |
|||
045000900 |
|||
600000007 |
|||
007000580 |
|||
010067008 |
|||
009008000 |
|||
026400735]- |
|||
</lang> |
|||
output: |
|||
<pre> |
|||
394 852 671 |
|||
268 371 459 |
|||
571 694 823 |
|||
145 783 962 |
|||
682 945 317 |
|||
937 126 584 |
|||
413 567 298 |
|||
759 238 146 |
|||
826 419 735 |
|||
</pre> |