sudoku-stats

1.0.3 • Public • Published

SUDOKU-STATS

CircleCI Codecov Codecov

Repository

The code for the project can be found here: https://github.com/RaptorCentauri/sudoku-stats

Description

Get stats about your sudoku!

INSTALATION

npm install sudoku-stats

TESTING

npm test

USAGE

In this program, a sudoku is a 9x9 matrix. Each index array represents a row in the sudoku, read from left to right

import Sudoku from 'sudoku-stats'

const sudoku = new Sudoku(sudoku)

API

Methods

Sudoku.getBox(box)

box: an integer representing the box number in the sudoku, from 1-9

Will return and array containing the digits in the given box of the sudoku

sudoku.getBox(1)

Sudoku.getColumn(col)

col: an integer representing the column number in the sudoku, from 1-9

Will return and array containing the digits in the given column of the sudoku

sudoku.getColumn(1)

Sudoku.getRow(row)

row: an integer representing the row number in the sudoku, from 1-9

Will return and array containing the digits in the given row of the sudoku

sudoku.getRow(1)

Sudoku.hasValidBoxTotal(box)

box: an integer representing the box number in the sudoku, from 1-9

Will return true if all digits in the given box sum to 45

sudoku.hasValidBoxTotal(1)

Sudoku.hasValidColumnTotal(col)

col: an integer representing the column number in the sudoku, from 1-9

Will return true if all digits in the given column sum to 45

sudoku.hasValidColumnTotal(1)

Sudoku.hasValidRowTotal(row)

row: an integer representing the row number in the sudoku, from 1-9

Will return true if all digits in the given row sum to 45

sudoku.hasValidRowTotal(1)

Sudoku.hasValidTotal()

Will return true if all digits in the sudoku sum to 405

sudoku.hasValidTotal()

Package Sidebar

Install

npm i sudoku-stats

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

10.9 kB

Total Files

15

Last publish

Collaborators

  • raptorcentauri