Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

ngshiheng/sudoku

Repository files navigation

Sudoku

A web-based Sudoku solver built using Python and Python only


The motivation is to demonstrate how Backtracking algorithm works.

Some of the key highlights/features of this Sudoku solver app:

  • Ability to generate a random, valid Sudoku puzzle
  • Solves a Sudoku puzzle using backtracking
  • Able to check if a Sudoku board is valid
  • Demo is hosted on Koyeb

Getting Started

Installation

Make sure you have poetry installed on your machine.

# make install
poetry install

# Optional: Installing dependencies only
poetry install --no-root

# Optional: Updating dependencies to their latest versions
poetry update

Usage

To run on debug mode locally on your browser:

# make dev
poetry run python3 main.py --debug=True --port=8080

Then, visit http://localhost:8080/ on your browser.

Pre-commit Hooks

Before you begin your development work, make sure you have installed pre-commit hooks.

Some example useful invocations:

  • pre-commit install: Default invocation. Installs the pre-commit script alongside any existing git hooks.
  • pre-commit install --install-hooks --overwrite: Idempotently replaces existing git hook scripts with pre-commit, and also installs hook environments.
  • pre-commit run: Run hooks.

Deployment

Check this out.

To generate a requirements.txt file:

# This command exports the poetry lock file to other formats.
# make generate
poetry export -f requirements.txt --output requirements.txt

Contributing

See CONTRIBUTING.md

References