-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PossibleCellsForNumber Region Based Implementation
Updated PossibleCellsForNumber to display number values when case board is clicked and generate proper case boards based off number chosen and local region.
- Loading branch information
Showing
4 changed files
with
44 additions
and
60 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/main/java/edu/rpi/legup/puzzle/sudoku/ModelSudokuBoard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package edu.rpi.legup.puzzle.sudoku; | ||
|
||
public class ModelSudokuBoard { | ||
public int getModelRegionNumbers(int index) { | ||
int columnMod = index % 3 + 1; | ||
int rowMod = ((index / 9) % 3) * 3; | ||
return columnMod + rowMod; | ||
} | ||
|
||
public int getModelRowNumbers(int index) { | ||
return index % 9 + 1; | ||
} | ||
|
||
public int getModelColumnNumbers(int index) { | ||
return index / 9 + 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters