8000 GitHub - kevinkoosk/pairtea: A multilingual matching-card and learning game for the terminal, built with Go, Bubble Tea and Lip Gloss. · GitHub
[go: up one dir, main page]

Skip to content
kevinkooskPublic

About

A multilingual matching-card and learning game for the terminal, built with Go, Bubble Tea and Lip Gloss.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

PairTea

Match. Learn. Steep your memory.

PairTea is a multilingual matching-card game for the terminal, written in Go with Bubble Tea. A pair contains two related values, so the same dictionary can provide an ordinary matching game or a learning game—for example, Apple ↔ Apple in Classic mode and Apple ↔ 苹果 píngguǒ in Learning mode.

Co-creators

PairTea was co-created by Kevin Koo Seng Kiat and OpenAI's ChatGPT.

  • Kevin Koo Seng Kiat — instigator and creative director: originated the game, matching mechanics, grid and control ideas, themed dictionaries, kaomoji centre tile, learning direction, progressive peeks and victory-animation concept.
  • OpenAI's ChatGPT — implementer and design collaborator: translated the concept into the initial Go application, Bubble Tea state model, Lip Gloss interface, multilingual pair architecture, tests and documentation.

The project has developed through an ongoing human–AI collaboration: Kevin supplies the originating ideas, play-testing and product judgment; ChatGPT assists with implementation, architecture and refinement.

Version 0.3 features

  • Ten difficulty levels from 2×3 to 8×8
  • 7× A3D0 7 board with a centre kaomoji narrator
  • Custom boards from 2×2 to 8×8
  • Arrow keys and WASD movement
  • Space, X or Enter to reveal cards
  • Timed hiding after a mismatch
  • Classic mode for matching identical cards
  • Learning mode for bilingual and associative matching
  • Six built-in dictionaries with 32 pairs each
  • Portable custom dictionaries loaded from UTF-8 JSON
  • Safe validation with readable warnings for malformed dictionary files
  • Capacity-aware difficulty choices for smaller study packs
  • Three example packs: periodic-table symbols, English synonyms and English–Malay numbers
  • Progressive two-second peeks, each costing five moves
  • Remaining peeks during play and usage on the victory screen
  • Move counter and timer
  • Rotating tea-themed match messages and scaled victory messages
  • Responsive card widths and Unicode-aware text measurement
  • Windows, Linux and macOS source compatibility

Difficulty levels

Level Grid Pairs Special tile
1 2×3 3 —
2 3×3 4 (•‿•)
3 3×4 6 —
4 4×4 8 —
5 4×5 10 —
6 5×5 12 (•‿•)
7 5×6 15 —
8 6×6 18 —
9 7×7 24 (•‿•)
10 8×8 32 —

Build and run

PairTea uses Bubble Tea v2 and Lip Gloss v2 and requires Go 1.25 or newer.

go mod tidy
go test ./...
go run .

Build a standalone executable:

go build -o pairtea .

On Windows PowerShell:

go build -o pairtea.exe .
./pairtea.exe

For Chinese text, use a UTF-8 terminal and a font containing CJK glyphs. Windows Terminal with Cascadia Mono plus a CJK fallback font normally works; other modern terminals generally work as well. If characters appear as empty boxes, change the terminal font rather than the source encoding.

Controls

Action Keys
Move Arrow keys or W/A/S/D
Reveal Space, X or Enter
Peek # (allowance depends on board size; each costs five moves)
Help ?
New game @ or Esc
Quit ! or Q
Immediate quit Ctrl+C

Built-in dictionaries

Dictionary Classic mode Learning mode
Fruits English ↔ English English ↔ Mandarin characters and pinyin
Animals Animal ↔ same animal Animal ↔ name of its young
Countries Country ↔ same country Country ↔ capital city
Vegetables English ↔ English English ↔ Bahasa Melayu
Flowers Common name ↔ same name Common name ↔ botanical name or group
Kaomoji Kaomoji ↔ same kaomoji Kaomoji ↔ feeling or action

Custom dictionaries

PairTea checks a dictionaries folder in the current directory and beside the compiled executable. Copy a .json study pack into that folder and restart the game; it will appear in the menu with a [custom] label. Custom dictionaries are inert local data—PairTea does not execute them or use the network.

{
  "format_version": 1,
  "name": "Chemical Elements",
  "description": "Element names and symbols",
  "side_a": "Element",
  "side_b": "Symbol",
  "pairs": [
    { "a": "Hydrogen", "b": "H" },
    { "a": "Helium", "b": "He" }
  ]
}

Classic mode matches a ↔ a; Learning mode matches a ↔ b. See the custom dictionary guide for validation rules and the examples folder for ready-made packs. The periodic-table example contains 36 pairs and can support every board size; its element spellings and symbols follow the IUPAC periodic table.

Peek allowances

Board size Peeks
Up to 40 tiles 1
41–60 tiles 2
More than 60 tiles 3

The 7×7 board therefore receives two peeks, while the 8×8 board receives three.

Design direction

Dictionaries use Pair{Left, Right} rather than assuming both cards contain the same text. This supports vocabulary, countries and capitals, legal terms and definitions, Bible characters and descriptions, and user-authored study packs without changing the game engine.

The centre kaomoji is intentionally part of the domain rather than a disposable decoration. A later version can give it reactions, rotating tea jokes and theme-specific hints.

Roadmap

v0.4.0 candidate — Classroom polish

  • Optional larger-text presentation layout
  • Faster ways to copy, inspect and validate study packs
  • Consider a moderator-controlled reveal cadence for audience play

Later milestone — Progressive victory effects

  • Add skippable terminal-text victory animations
  • Reward larger completed boards with richer effects
  • Preserve reduced-motion and no-animation options
  • Evaluate small native Bubble Tea effects and appropriately attributed MIT-licensed references, including TerminalTextEffects-inspired Go projects

Status

This is the v0.3 development release. The core game, custom dictionary loader, examples and unit tests are included. Run go test ./... locally before publishing a binary release.

License

MIT. See LICENSE.

About

A multilingual matching-card and learning game for the terminal, built with Go, Bubble Tea and Lip Gloss.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0