Skip to content

Instantly share code, notes, and snippets.

View paulsonkoly's full-sized avatar

Paul Sonkoly paulsonkoly

View GitHub Profile
require 'set'
require 'forwardable'
# Board is a 9x9 standard sudoku board. This class does not care about what is
# stored in each cell of the board, it merely provides indexing and enumeration
# methods including accessing rows, columns, or 3x3 sudoku boxes.
class Board
extend Forwardable
# @param data [Array] flat array of 81 initial cell values
require 'active_support/inflector'
# Argument parsing
# My solution to http://codingdojo.org/kata/Args/
module Args
# Error occured during argument parsing. {StandardError#message} should give
# a description about the error.
class ArgsError < StandardError; end
# An argument schema.
require 'set'
require 'forwardable'
# Board is a 9x9 standard sudoku board. This class does not care about what is
# stored in each cell of the board, it merely provides indexing and enumeration
# methods including accessing rows, columns, or 3x3 sudoku boxes.
class Board
extend Forwardable
# @param data [Array] flat array of 81 initial cell values
<style type="text/css"> body { margin: 1em; width: 80%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } kbd { display: inline-block; margin: 0 .1em; padding: .1em .6em;