Skip to content

Instantly share code, notes, and snippets.

@lancewalton
lancewalton / Sudoku.scala
Created November 2, 2011 22:21
A Sudoku solver in Scala
package sudoku
case class Location(row: Int, col: Int) {
def areValuesMutuallyExclusive(other: Location, size: Int) =
isInSameRow(other) ||
isInSameColumn(other) ||
isInSameSmallSquare(other, size)
private def isInSameRow(other: Location): Boolean = row == other.row