Giter Club home page Giter Club logo

sudoku-zig's Introduction

Sudoku

A Sudoku game that doesn't come with puzzles in the box, bring your own! Supports all box sizes as long as they hold between 2 and 16 numbers, and has a solver included. Lets you pencil out the candidates as well, which is necessary for advanced techniques. Jigsaw (squiggly) puzzles are also supported, but manually entering them in CLI is tedious.

image

Running

This should get you going after cloning the repo:

zig build run -- 3 3 72..96..3...2.5....8...4.2........6.1.65.38.7.4........3.8...9....7.2...2..43..18

NOTE: The sudoku string has to contain valid clue characters, anything else is considered as an empty cell.

image

Controls

Action Key
Quit game Escape
Select cell Left mouse button
Move selection Arrow keys
Place number <1-9,A-G>
Toggle candidate Shift + <1-9,A-G>
Clear number <0>, Del
Undo Ctrl + Z
Redo Ctrl + Shift + Z
Fill candidates H
Fill all candidates Ctrl + H
Clear candidates Shift + H
Solve Enter
Get/apply a hint Shift + Enter

NOTE: Getting a hint only works if you already placed candidates on the board and assumes they are correct. A preview will be shown to you with what the solver found and the game will wait for you to press the key again to apply it.

Examples

4x3 sudoku

zig build run -- 4 3 8.9....B.4C.C......3.B9...B5..A8.2...2.4..5........9........7...1B69...32...C47A...B........5........1..A.7...5.87..13...8A.3......2.14.5....8.C

image

Jigsaw sudoku

zig build run -- 3 3 .38.4.1...6.9532......6....97......54..........5..2......6..8...57....6.34.8..... 111111222113444422133455442334455222366657777366559997366659977386858997888888997

NOTE: Jigsaw puzzles need a second string that matches each cell with its associated region, so it's like the sudoku string but instead of clues you write the region index.

image

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.