Skip to content

Instantly share code, notes, and snippets.

@jezinka

jezinka/Board.groovy Secret

Created Oct 16, 2018
Embed
What would you like to do?
class Board {
Integer[][] sample = [
[0, 0, 0, 0, 0, 2, 0, 0, 3],
[6, 0, 0, 0, 3, 0, 0, 0, 9],
[9, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 4, 5, 0, 0, 0, 6, 0, 0],
[8, 0, 0, 6, 0, 0, 3, 0, 7],
[0, 0, 0, 0, 0, 0, 8, 5, 2],
[4, 9, 0, 0, 6, 3, 0, 0, 5],
[0, 3, 0, 5, 0, 8, 0, 0, 0],
[0, 0, 0, 4, 9, 0, 0, 0, 0]
]
Cell[][] board = new Cell[9][9]
Board() {
for (int i = 0; i < sample.length; i++) {
for (int j = 0; j < sample[i].length; j++) {
board[i][j] = new Cell(value: sample[i][j])
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment