Skip to content

Instantly share code, notes, and snippets.

View kierarad's full-sized avatar

Kiera Radman kierarad

View GitHub Profile
class Sudoku
attr_reader :position, :current_cell_value
def initialize(board_string)
@board = []
@board_string = board_string
@position = [7,6] #[row, col]
@board_string.split(//).each_slice(9) {|slice| @board << slice}
@current_cell_value = @board[@position[0]][@position[1]]
@box_coord_hash = { box1: [[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[2,0],[2,1],[2,2]],