cli-games

module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2025 License: BSD-2-Clause

README

CLI Games monorepo

This repository contains small terminal-based games designed for my kids.

lettersnake ortotris

Lettersnake

The concept is that you get a word in one language and you need to collect letters to form its translation in another.

See screenshot below:

Lettersnake

Running

To play the game just run:

cd cmd/lettersnake
go run *.go start -f ../../game-files/lettersnake/words-pl-en-animals.txt
Instructions

Use arrows to steer the snake.

Words file

The words for the game are provided via the -f argument, and the file's format is straightforward.

First line is the title of the list. And starting second one, every line contains a word in one language and its translation in another (which needs to be guessed). Words are delimetered by a colon (:). Space cannot be used, so an underscore (_) is preffered.

For example, a sample file might look like this:

Polish-English Places
hol:hall
garaż:garage
jadalnia:dining_room

Ortotris

It is inspired by the classic DOS game Ortotris, released in 1992, which was similar to Tetris but focused on improving spelling skills. The game runs in the terminal and follows a similar concept to help players with orthography.

See screenshot below:

Ortotris

Running

To play the game just run:

cd cmd/ortotris
go run *.go start -f ../../game-files/ortotris/words-u-o.txt
Instructions

Words descend from the top of the screen, similar to Tetris, but with one or two missing letters, indicated by an underscore (_). Use the left and right arrow keys to select one of the available letters before the word reaches the bottom. If an incorrect letter is chosen, the word will remain at the bottom. You can also press the down arrow to drop the word immediately.

Words file

The words for the game are provided via the -f argument, and the file's format is straightforward.

The first line is a title of the dictionary file. The second line specifies two or more letters that the player will choose between, separated by a colon (:). The following lines contain the words, which will be shuffled during the game. Each line includes two values, also separated by a colon. The first value is the word, with the missing letter(s) represented by an underscore (_), and the second value is the correct answer.

For example, a sample file might look like this:

Words with "u" or "ó"
u:ó
r_ża:ó
mal_je:u

Directories

Path Synopsis
cmd
lettersnake command
Package main is the entry point for the lettersnake command-line game.
Package main is the entry point for the lettersnake command-line game.
ortotris command
Package main is the entry point for the ortotris command-line game.
Package main is the entry point for the ortotris command-line game.
pkg
lettersnake
Package lettersnake contains game logic.
Package lettersnake contains game logic.
ortotris
Package ortotris contains game logic.
Package ortotris contains game logic.
term
Package term contains some helper functions.
Package term contains some helper functions.
termui
Package termui is designed to simplify output to a terminal window by allowing the specification of panes with static or dynamic content.
Package termui is designed to simplify output to a terminal window by allowing the specification of panes with static or dynamic content.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL