Sudoku: Difference between revisions
Content deleted Content added
No edit summary |
|||
Line 3,705:
=={{header|Rascal}}==
[[File:sudoku.jpeg||200px|thumb|right]]
<lang Rascal>public rel[int,int,int] sudoku(rel[int x, int y, int v] sudoku){
annotated= annotateGrid(sudoku);
Line 3,733 ⟶ 3,734:
}
//adds gridnumber and default set of options
public rel[int,int,int,int,set[int]] annotateGrid(rel[int x, int y, int v] sudoku){
result = {};
Line 3,754 ⟶ 3,757:
}
//reduces set of options
public rel[int,int,int,int,set[int]] reduceOptions(rel[int x, int y, int v, int g, set[int] p] subSudoku){
solved = {<x,y,v,g,p> | <x,y,v,g,p> <- subSudoku, v!=0};
Line 3,769 ⟶ 3,773:
}
//a sudoku
public rel[int, int, int] sudokuA =
{
|