Git Product home page Git Product logo

boilerplate-project-sudoku-solver's Introduction

freeCodeCamp - Quality Assurance 4: Sudoku Solver

Run on Repl.it

User stories:

  1. I can enter a sudoku puzzle by filling in the text area with either a number or period (.) to represent an empty cell.
  2. When a valid number is entered in the text area, the same number is applied to the correct cell of the sudoku grid.
  3. I can enter a sudoku puzzle by adding numbers directly to the sudoku grid.
  4. When a valid number is entered in the sudoku grid, the same number appears in the correct position in the text area.
  5. The text area should only update the corresponding sudoku grid cell when a whole number between 1 and 9 is entered.
  6. The sudoku grid should only update the puzzle string in the text area when a whole number between 1 and 9 is entered into a cell.
  7. I can solve an incomplete puzzle by clicking the "Solve" button. When a solution is found, the sudoku grid and text area are automatically populated with the correct numbers for each cell in the grid or position in the text area.
  8. This sudoku solver is not expected to be able to solve every incomplete puzzle. See /public/puzzle-strings.js for a list of puzzle strings it should be able to solve along with their solutions.
  9. If the puzzle is not 81 numbers or periods long, append the message "Error: Expected puzzle to be 81 characters long." to the error-msg div so the text appears in red.
  10. I can clear the text area and sudoku grid by clicking the "Clear" button.
  11. All 6 unit tests are complete and passing. See /tests/1_unit-tests.js for the expected behavior you should write tests for.
  12. All 4 functional tests are complete and passing. See /tests/2_functional-tests.js for the functionality you should write tests for.

Testing and additional notes

  • To run the tests on Repl.it, set NODE_ENV to test without quotes in the .env file.
  • To run the tests in the console, use the command npm run test. To open the Repl.it console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell".
  • All logic can go into public/sudoku-solver.js.
  • Create all of the unit/functional tests in tests/1_unit-tests.js and tests/2_functional-tests.js.

boilerplate-project-sudoku-solver's People

Contributors

scissorsneedfoodtoo avatar mot01 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.