anakojm / peg-solitaire

A game of peg-solitaire, moved to sourcehut

Home Page:https://git.sr.ht/~anakojm/peg-solitaire

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Peg solitaire

A game of peg solitaire in the terminal, written in python


  • Select "from" with the arrow keys or hjkl, confirm with enter or space
  • Cancel by reselecting "from" and confirming with enter or space
  • Select "to" with the arrow keys or hjkl, confirm with enter or space
  • Quit anytime with escape, q or m
  • You can switch between the European and the English version by switching a boolean in the code, a custom board is also possible.
  • You can save a game with s or J, you can't save a game after selecting a peg, for technical reasons (I suck a programming), you can cancel saving by inputting a blank file
  • You can load a game with L, you can cancel loading by inputting a blank file
  • All the keybinds are easily configurable in the code

UI: · indicates a peg in a hole, * emboldened indicates the peg to be moved, and o indicates an empty hole. A blue ¤ is the hole the current peg moved from; a red * is the final position of that peg, a red o is the hole of the peg that was jumped and removed.


The goal of the game is to empty the board except for one center peg.

To reach that goal you can move a piece. You can only move a piece by "jumping" over another one, "eating" it in the process.

The destination must be empty.


Screenshot:

UI showcase


TODO: grep "TODO" peg_solitaire.py

Thank you to u/RiceKrispyPooHead and mason1920 for their help!

About

A game of peg-solitaire, moved to sourcehut

https://git.sr.ht/~anakojm/peg-solitaire

License:GNU General Public License v3.0


Languages

Language:Python 100.0%