AlexGustafsson / sudoku

A Sudoku implementation using modern techniques such as modern EcmaScript, Poi (Webpack, Babel etc.) and Vue

Home Page:https://sudoku.axgn.se

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sudoku

A sudoku implementation using modern techniques such as modern EcmaScript, Poi (Webpack, Babel etc.) and Vue. Check it out live.

Demo

Quickstart

# Clone the repository
git clone https://github.com/AlexGustafsson/sudoku

# Enter the directory
cd sudoku

## Option A:
# Install dependencies
npm install
# Option A 1: Run development server
npm run dev
# Option A 2: Build and run minimal server
npm run build
npm run start

## Option B:
# Build and run using Docker
./docker-build.sh
docker run -it -p 3000:80 axgn/sudoku

# You can now go to http://localhost:3000 or http://localhost:4000 if you're using the development server

Table of contents

Quickstart
Features
Algorithms
Technology
Development
Disclaimer

Features

Note: these images are somewhat outdated and will be updated shortly. Features will also be mentioned more concretely.

Demo

Demo

Algorithms

Grid generation

The algorithm to generate a complete grid.

Terminology

  • Let the grid consist of subgrids of cells. Each subgrid contains 9 cells. Each cell has a coordinate {x, y} (such as {0 ≤ x ≤ 9, 0 ≤ y ≤ 9}).
  • For each cell in the grid.
    • Let neighbors be all cells that either intersect the horizontal crossing line ({0 ≤ x ≤ 8, y}), the vertical crossing line ({x, 0 ≤ y ≤ 8}) or are part of the same subgrid.
    • Let possible numbers be numbers that have not yet been tried for the cell and are not included in the neighbors.
    • If there are possible numbers:
      • Pick a random possible number and assign it to the cell. Mark the number as tested for the cell.
      • Move to the next cell.
    • If there are no possible neighbors.
      • Go back to the previous cell.
      • Remove all tried numbers for any future cells.
      • Go to step 2.1 again.

Technology

Poi

Poi is a zero-config bundler built on the top of webpack. By using the buzz word zero-config, it does not mean that there's no config, instead we pre-configurared many things for you. To prevent Poi from becoming too bloated to use, we also introduced some kind of plugin system to make extra features opt-in.

Visit Poi here.

Vue

Vue (pronounced /vjuː/, like view) is a progressive framework for building user interfaces. It is designed from the ground up to be incrementally adoptable, and can easily scale between a library and a framework depending on different use cases. It consists of an approachable core library that focuses on the view layer only, and an ecosystem of supporting libraries that helps you tackle complexity in large Single-Page Applications.

Visit Vue here.

Development

# Clone the repository
git clone https://github.com/AlexGustafsson/sudoku

# Enter the directory
cd timekeep

# Install dependencies
npm install

# Follow the conventions enforced
npm run lint
npm run stylelint
npm run coverage
npm run check-duplicate-code

# Build for production
npm run build

Disclaimer

Although the project is very capable, it is not built with production in mind. Therefore there might be complications when trying to use the engine for large-scale projects meant for the public. The project was developed to easily use "play" Sudoku and as such it might not promote best practices nor be performant.

About

A Sudoku implementation using modern techniques such as modern EcmaScript, Poi (Webpack, Babel etc.) and Vue

https://sudoku.axgn.se

License:MIT License


Languages

Language:JavaScript 57.3%Language:CSS 22.0%Language:Vue 18.0%Language:HTML 1.8%Language:Dockerfile 0.5%Language:Shell 0.4%