yayagram - Play nonograms/picross in your terminal

Overview

yayagram - Play nonograms/picross in your terminal

yayagram is a puzzle game in which you fill out a grid with cells based on logic and number clues.

Showcase

White signifies a filled cell, red signifies a crossed out cell.

Playing it is as easy as:

cargo install yayagram
yayagram

Binaries are also provided in the Releases.

Features

  • Runs in the terminal!
  • Cross-platform: runs on Linux, Windows and macOS.
  • Helpful features like undo, redo and reset that are just a button press away.
  • Create your own grids for others to play.
  • A new kind of cell: maybed.
  • A measurement tool to let you enjoy even the biggest of grids.
  • Intuitive to play.

Controls

  • Mouse movement: select a cell.
  • Left-click: fill a cell.
  • Middle-click: maybe a cell.
  • Right-click: cross out a cell.
  • R: reset the grid.
  • Q: undo cell placements or a grid reset.
  • E: redo cell placements or a grid reset.
  • X: set measurement point.
  • W, A, S, D and arrow keys: darken the cells in that direction.
  • Tab: toggle the editor.
  • Enter: save the edited grid as a file locally.
  • Esc: exit.

Editor

Press Tab to toggle the editor and start placing the cells for your grid. You can make use of all cell kinds. To export your grid, press Enter to save while in editor mode. This will create a new .yaya grid file. Note that in the same session it will always write the grid to the same file again unless renamed.

On Windows you can drag .yaya grid files onto the .exe to play the grid. On Linux and macOS the .yaya file is passed via the command line.

img2yaya

As an alternative to the editor you can generate .yaya grids using @AaronErhardt's amazing img2yaya to convert images to playable .yaya files!

Command line arguments

The program takes a single number for a squared grid size, two numbers for a width and height or the filename of a .yaya grid file.

yayagram # a random 5x5 grid
yayagram 10 # a random 10x10 grid
yayagram 5 15 # a random 5x15 grid
yayagram example.yaya # a custom grid

--help, -h and --version, -V are also supported.

Measurement tool

Particularly on bigger grids it can sometimes become hard to count all the cells. For this you can use the measurement tool. Simply press X to set your first point and then X again to set your second point. You will then be able to see the distance between those two points with the measured cells that appear. Measured cells never overwrite cell kinds other than empty cells and its own.

If you save a grid that contains measured cells, their distance indices won't be saved and the measured cells will only appear as green when that grid is loaded.

Maybed

The blue "maybed" cell kind can be placed on the grid with middle-click and is supposed to make "what if?" reasoning and trying out things easier, as an alternative to using crossed out or filled cells which might be confusing. It can help you imagine theoretical situations better.

Other Tips

  • Try to avoid guesssing and play it safe! Guessing can come back later to bite you. Guessing is unsafe.
  • Don't forget to cross out cells that you are sure won't be filled. This helps immensely at ruling out possibilities.

Example

Here's a simple example to help you grasp the game.

2 3 2
2
3
2

First, let's look at the clues on the very top: the first one is 2. It tells us that exactly 2 (2 cells in a row) of the 3 cells below it are filled. Through logic we can determine that this means that at least the middle cell is definitely filled:

2 3 2
2
3
2

Let's look at what the clue next to it to the right tells us (3). This clue means that there is exactly 3 cells in a row filled below. Because we only have 3 cells here (because it's a 3x3 grid), we can simply fill out all of those 3 cells safely:

2 3 2
2
3
2

Next clue on the top: 2. Again through logic we can determine that at least the cell in the middle is definitely filled:

2 3 2
2
3
2

Now let's continue with the clues on the left, starting with the top one: 2. Here it's the same, there is definitely at least the middle cell filled, which is already the case so we can simply move on with the clue below it: 3. The row is already filled out so let's move on to the next one: 2. Again, nothing to do. It turns out that we have a pretty rare case here where two solutions are correct:

2 3 2
2
3
2

or

2 3 2
2
3
2

Both solutions fulfill the requirements.

I hope this helped you grasp the game a little bit. Now you can try to apply some of what you learned on a small grid like 3x3 or 5x5 by simply passing the grid size as a command line argument to the program: yayagram 3 or yayagram 5 respectively.

You can also load the above grid into the game by passing this file as a command line argument to the binary: example.yaya.

You might also like...
Currency exchange rates in your terminal

Usage example Rates is a scriptable CLI tool that brings currency exchange rates right into your terminal and supports 30+ fiat and 10K+ crypto currencies.

 Amp: A text editor for your terminal.
Amp: A text editor for your terminal.

Amp: A text editor for your terminal. Heavily inspired by Vi/Vim. Amp aims to take the core interaction model of Vim, simplify it, and bundle in the e

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.
Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Pokédex in your terminal, thanks to Rust

mon - a command line Pokédex Uses art from pokemon-colorscripts and Pokémon data from PokéAPI. Building Rust up! Tested on: rustc --version rustc 1.

Display a random Shiba from your terminal whenever you feel the need to. Because why not?
Display a random Shiba from your terminal whenever you feel the need to. Because why not?

Shiba CLI Command-line interface (CLI) to display a random Shiba Inu whenever needed, by just running shiba on your terminal. How To Use • How Does It

Display candlestick chart in your terminal.
Display candlestick chart in your terminal.

cli-candlestick-chart This module allows you to display candle charts directly in your terminal. I did this project mainly to learn Rust, so the code

Nazuna - 🐦  Download Twitter videos using your terminal!
Nazuna - 🐦 Download Twitter videos using your terminal!

Nazuna 🐦 Download Twitter videos using your terminal! Installation Binary Download the desired file for your OS (Windows, Mac, Linux) from https://gi

The-way - A code snippets manager for your terminal.
The-way - A code snippets manager for your terminal.

The Way A code snippets manager for your terminal. Record and retrieve snippets you use every day, or once in a blue moon, without having to spin up a

🏝️ Set wallpaper from your terminal!

WLP Set wallpaper from your terminal. It works on Linux, Mac and Windows. Installation Manual git clone https://github.com/ahmadrosid/wlp.git cargo in

Comments
  • Remove square shape requirement

    Remove square shape requirement

    Hey!

    I really enjoyed playing yayagram (I really like nonograms in general) and had the idea of automatically generating .yaya files from images. I quickly implemented a prototype and it worked out pretty well yet during testing I came across a weird error message saying "malformed data" when opening a generated file. When looking for the cause in your code I found the following lines:

    if width != height {
        return Err(LoadError {
            message: "malformed data",
            line_number: None,
        });
    }
    

    Well, first this error message isn't very descriptive. But more importantly, nonograms are not necessarily square shaped. Especially when converting images this can be a problem as the image would need to be scaled or resized if it's not square shaped which is suboptimal. So I wonder whether this check could be simply removed... at least that would help me a lot with my image to yayagram converter :)

    opened by AaronErhardt 3
  • `cargo install yayagram` fails in tanmatsu

    `cargo install yayagram` fails in tanmatsu

    Hello,

    Trying to install yayagram gives me the following error.

    $ cargo install yayagram
    # ... listing of downloaded crates ...
    error[E0277]: the trait bound `fn(u16) -> MoveToNextLine {MoveToNextLine}: crossterm::Command` is not satisfied
       --> C:\Users\anon\.cargo\registry\src\github.com-1ecc6299db9ec823\tanmatsu-0.6.3\src\sys\other.rs:222:27
        |
    222 |         self.stdout.queue(cursor::MoveToNextLine).unwrap();
        |                     ----- ^^^^^^^^^^^^^^^^^^^^^^ the trait `crossterm::Command` is not implemented for `fn(u16) -> MoveToNextLine {MoveToNextLine}`
        |                     |
        |                     required by a bound introduced by this call
        |
    note: required by a bound in `queue`
       --> C:\Users\anon\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm-0.20.0\src\command.rs:60:39
        |
    60  |     fn queue(&mut self, command: impl Command) -> Result<&mut Self>;
        |                                       ^^^^^^^ required by this bound in `queue`
    
    error[E0277]: the trait bound `fn(u16) -> MoveToPreviousLine {MoveToPreviousLine}: crossterm::Command` is not satisfied
       --> C:\Users\anon\.cargo\registry\src\github.com-1ecc6299db9ec823\tanmatsu-0.6.3\src\sys\other.rs:226:27
        |
    226 |         self.stdout.queue(cursor::MoveToPreviousLine).unwrap();
        |                     ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `crossterm::Command` is not implemented for `fn(u16) -> MoveToPreviousLine {MoveToPreviousLine}`
        |                     |
        |                     required by a bound introduced by this call
        |
    note: required by a bound in `queue`
       --> C:\Users\anon\.cargo\registry\src\github.com-1ecc6299db9ec823\crossterm-0.20.0\src\command.rs:60:39
        |
    60  |     fn queue(&mut self, command: impl Command) -> Result<&mut Self>;
        |                                       ^^^^^^^ required by this bound in `queue`
    
    For more information about this error, try `rustc --explain E0277`.
    error: could not compile `tanmatsu` due to 2 previous errors
    warning: build failed, waiting for other jobs to finish...
    error: failed to compile `yayagram v0.8.0`, intermediate artifacts can be found at `C:\cygwin64\tmp\cargo-installklkVGp`
    
    Caused by:
      build failed
    
    opened by gamma-delta 1
Releases(v0.8.0)
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

hmirin 5 Jun 20, 2023
Lists Steam applications that have specified a Steam Play compatibility tool

proton-usage Lists Steam applications that have specified a Steam Play compatibility tool. Useful for when you want to remove/uninstall unused compati

Chris 10 Nov 13, 2022
Play videos on IT8951-controlled e-paper displays

it8951-video Play videos on IT8951-controlled e-paper displays via USB. This has been tested with a Waveshare 7.8inch e-Paper HAT display. Design This

Andreas Dzialocha 4 Nov 28, 2022
A series of crates that I made to compile images/video into asciinema & play them.

Bad Apple A series of crates that I made to compile images/video into asciinema & play them. The end goal is to make a kernel & legacy bootloader that

S0ra 10 Nov 29, 2022
xyz is a chat platform where people sign up, play a matching game, and say goodbye

xyz is an asynchronous chat and web service What you need Docker Desktop ?? Cargo (Rust package manager) ?? Clone our project Follow the steps below t

Matthew 12 Oct 11, 2023
Print your git contributions in your terminal, blazingly fast

Takoyaki Blazingly fast git contribution graph in your terminal Features ✔️ Customizable ✔️ Plugins to support a bunch of cloud based git repositories

kyeboard 13 Feb 6, 2023
Get your github contributions right in your terminal, blazingly fast!

GitColorScripts Get your github contributions right in your terminal! Installation Install via yay yay -S gitcolorscripts Install manually Download t

VoidCupboard 56 Jul 12, 2023
A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.

Terminal Media Player View images, videos (files or YouTube links), webcam, etc directly in the terminal as ASCII. All images you see below are just m

Max Curzi 36 May 8, 2023
A simple and efficient terminal UI implementation with ratatui.rs for getting quick insights from csv files right on the terminal

CSV-GREP csv-grep is an intuitive TUI application writting with ratatui.rs for reading, viewing and quickly analysing csv files right on the terminal.

Anthony Ezeabasili 16 Mar 10, 2024
create and test the style and formatting of text in your terminal applications

description: create and test the style and formatting of text in your terminal applications docs: https://docs.rs/termstyle termstyle is a library tha

Rett Berg 18 Jul 3, 2021