Crates.io | yayagram |
lib.rs | yayagram |
version | 0.8.5 |
source | src |
created_at | 2021-05-24 14:13:59.823853 |
updated_at | 2023-03-24 17:06:59.988606 |
description | Play nonograms/picross in your terminal |
homepage | |
repository | https://github.com/r00ster91/yayagram/ |
max_upload_size | |
id | 401440 |
size | 133,544 |
yayagram is a puzzle game in which you fill out a grid with cells based on logic and number clues in your terminal.
The game goes by many names: nonogram, picross, paint by numbers, griddlers, pic-a-pix, hanjie and others.
A randomized grid where white signifies a filled cell and red signifies a crossed out cell.
See this example to find out how to play.
Playing it is as easy as:
cargo install yayagram
yayagram
Binaries are also provided in the Releases.
The game is primarily played with both mouse and keyboard but can also be played exclusively with the keyboard. You don't need to memorize the following controls. The most important controls are displayed ingame.
.yaya
grid files with drag & drop onto the window.For anyone that prefers to use the vi keys, you may be interested in @Maugrift's wonderful fork which features an alternate control scheme!
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 S to save the grid as a new local .yaya
grid file while in editor mode.
Note that in the same session it will always write the grid to the same file again unless renamed.
.yaya
grid file with drag & drop onto the window. Many but not all terminals support this..yaya
file can be passed via the command line.As an alternative to the editor you can generate .yaya
grids using @AaronErhardt's amazing img2yaya to convert images to playable .yaya
files!
The program takes a single number for a squared grid size, two numbers for width and height, or the filename of a .yaya
grid file to load a custom user-made grid.
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.
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.
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 may be confusing. It can help you imagine theoretical situations better.
yayagram is very well suited for big grids, up to size 99x99. Here are the reasons:
unsafe
.'c'
for instance, the grid will be cleared because it's recognized as the C key being pressed.
This clear can be undone using the A key of course, but it may be confusing.
The same applies to items dropped onto the window. Press Enter before loading grid files.Here's a simple example to help you grasp the game.
2 | 3 | 2 | |
---|---|---|---|
2 | |||
3 | |||
2 |
This is our grid where we need to fill out these 9 empty fields with the help of the 6 clue numbers on the top and on the left. First, let's take a look at the 3 clues on the very top: the first one is 2. It tells us that exactly 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 example grid into the game with this file: example.yaya.