/Sudoku

Sudoku with CPP

Primary LanguageC++

Sudoku

Sudoku with CPP

There are two parts in this repo

  1. Sudoku Map Transformation
  2. Sudoku Map Solver

Execute code

transformation: make run
solve: make solve

1. Sudoku Map Transformation

Source: sudoku.cpp sudoku.h transform.cpp

Aim: Generate an equivalent Sudoku Map with user key-in function

Input: A 9x9 Sudoku Map
image
There are 5 methods to transform a Sudoku Map in this code

  1. Exchange two number in whole Sudoku Map

image

  1. Exchange two rows

image

  1. Exchange two cols

image

  1. Clockwise Rotate Sudoku Map 90 degree

image

  1. Mirror Inversion Sudoku Map(Horizontal, Vertical)

image

2. Sudoku Map Solver

There has a default grid inside code Input: A 9x9 Sudoku Map, blank space fills with 0 image

Method: Using recursive method to find the solution of given input.

Output: If there is a solution, output solution matrix else output No solution exists.

Caveat

There is not any error handling mechanism. Input must in range