fedeztk / sku

Simple TUI written in go to play sudoku in the terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sku

Simple TUI written in go to play sudoku in the terminal

GO GHCR AUR Go Report Card

Table of Contents

Usage - Features - Testing

sku is a simple TUI for playing sudoku inside the terminal. It uses the awesome bubbletea TUI library for the UI.

Screenshots here

Disclaimer: there are probably many other sudoku TUIs around with all kind of features that sku does not have. PRs are welcomed but it is generally a better idea to just use those programs, since adding some features, like a pencil mode used to annotate the sudoku, would require too much effort.

Usage

  • Install sku:

With the go tool:

go install github.com/fedeztk/sku/cmd/sku@latest

Or from source:

# clone the repo
git clone https://github.com/fedeztk/sku.git
# install manually 
make install

In both cases make sure that you have the go bin directory in your path:

export PATH="$HOME/go/bin:$PATH"

If you are an Arch user there is also an AUR package available:

paru -S sku-git
  • Run it interactively:
sku            # use default mode (easy)

For more information about version and modes check the help (sku -h)

Features

  • Minimal/clean interface, only displays the board, the help and the game state (timer and remaining cells). Cursor position is marked with green. Greyed cells are unmodifiable (the base of the sudoku); when the cursor is under those cells it will darken Screenshot from 2022-06-06 17-35-14

  • Game check:

    • when the last cell is filled, sku will perform a check of the sudoku:

      • if it is correct, an animation will let you know that you won the game
      Kooha-06-06-2022-17-57-36_cropped.mp4
      • otherwise it will color with red the errors Screenshot from 2022-06-06 17-36-56
  • Simple keys to interact with the puzzle:

    • moving around: use the arrows or the vim motion keys, as preferred
    • setting a cell: just press the desired number
    • unsetting a cell: press spacebar or enter
    • toggle help: press the question mark
    • quit: you can quit anytime by pressing esc or q Screenshot from 2022-06-06 17-36-19
  • Check the version with sku -v

  • Get the help menu with sku -h

  • Set a sudoku mode with sku MODE. Valid MODEs are: easy, medium, hard and expert (also displayed with -h flag)

Testing

Development is done through docker, build the container with:

make docker-build

Check that the build went fine:

docker images | grep sku

Test it with:

make docker-run

Pre-built Docker image available here

About

Simple TUI written in go to play sudoku in the terminal

License:MIT License


Languages

Language:Go 92.4%Language:Shell 4.7%Language:Makefile 2.0%Language:Dockerfile 1.0%