diff --git a/README.md b/README.md index 65328df..c4d2741 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,53 @@ # Sudoku A C++ library for generating, validating, solving, checking, etc Sudoku puzzle. + +# Installation +'make sudoku.cpp' +'./sudoku' + +# Todo + +## Code + +- [ ] Create Header files + +As what it stated ... + +- [ ] Reorganize code using OOP approach + +This is my first CPP project, I don't think I wrote OOP code properly. + +- [ ] Optimised code for performance + +The function 'SudokuSolution()' is an enhanced version of [ leetcode - Sudoku solver ]( https://leetcode.com/problems/sudoku-solver/ ) + +- [ ] Rename variable + +I wrote this in a rush , some variable is not named properly and are not consistent. rename it with meaningful variable name + +- [ ] Testing + +Testing is important. Any testing framework is fine but personally prefer bash scripting to test out the function. + +- [ ] Better output format + +Print it properly? Probably it will be ideal that I could see obvious changes to show the border of 3x3 box. + +## No Code + +- [ ] documentation + +Provide Documentation on each function on what it does. Please also provide documentation on elaboration on the algorithm especially for 'SudokuSolution()' and 'initialize()' + +# How to start contribute + +Please discuss in issues and I will assign the issues to you. +Once it is assigned, + +1. fork the repo +2. open a draft Pull Request + +# Special thanks + + + diff --git a/sudoku b/sudoku index ee2dd15..a0cea2b 100644 Binary files a/sudoku and b/sudoku differ diff --git a/sudoku.cpp b/sudoku.cpp index 458ca6e..d515250 100644 --- a/sudoku.cpp +++ b/sudoku.cpp @@ -146,7 +146,7 @@ bool Sudoku::GenerateSudoku() std::shuffle(numbers.begin(), numbers.end(), std::mt19937{std::random_device{}()}); for (int number : numbers) { - if (isPlacable(row, col, Board, number)) + if (isPlacable(row, col, number)) { // if (true){ Board[row][col] = number; @@ -177,7 +177,7 @@ int Sudoku::SudokuSolution() vector numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9}; for (int number : numbers) { - if (isPlacable(row, col, Board, number)) + if (isPlacable(row, col, number)) { Board[row][col] = number; @@ -227,28 +227,12 @@ int main() { Sudoku sudoku; sudoku.initialize(); - vector> temp = vector>(9, vector(9, 0)); - - // cout<<"empty row 1 | col 1 | value "<