Skip to content

XodTech/TerminalSolitaire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TerminalSolitaire - Solitaire Which You Can Run Inside Your Terminal

Introduction

TerminalSolitaire allows you to play classical solitaire game inside your terminal.You can control cards using commands inside game shell

Getting Started

  1. Install TerminalSolitaire using the installation instructions below
  2. Learn how to play reading "How to play" instructions bellow
  3. Enjoy the game!

Installation

Prerequisites:

  • git
  • python >= 3.13
  • A terminal emulator which supports color rendering

With uv:

  • Clone this repository
  • Move into cloned repository root directory
  • Launch game with uv run src/main.py

With pip

  • Clone this repository
  • Move into the cloned repository's root directory
  • Create virtual environment with python -m venv venv
  • Source virtual environment using:
    • source venv/bin/activate on Unix based OS
    • source.\venv\Scripts\activate on Windows.
  • Install necessary packages with pip install -r requirements.txt
  • Launch game with python src/main.py

How to Play

To play the game, use the following commands:

  • draw: Take a card from the deck
  • place [column_number]: Place the last card from the taken ones on the table in the specified column
  • flip [column_number]: Flip a card in the specified column
  • move [source_column] [destination_column]: Move a card from one column to another. You can also use the following separators: ->, :, =>, =, >, >>
  • foundation: Move cards to the foundation piles (in ascending order, same suit)
  • refresh: Refresh game table
  • restart: Restart the game
  • help: Shows list of all available commands

Example Commands

  • draw
  • place 3 (places the card in column 3)
  • flip 2 (flips a card in column 2)
  • move 1 3 or move 1 -> 3 (moves a card from column 1 to column 3)

Tips

  • The goal of Solitaire is to move all cards to the foundation piles
  • Cards in the tableau (columns) must be in descending order (King to Ace) and alternating colors (red and black)
  • Use the move command to build sequences and move cards to the foundation piles

Contributing

To contribute to this repository:

  • Fork the repository
  • Clone the forked repository to your local machine
  • Create a new branch for your contribution
  • Make changes, commit, and push to your fork
  • Create a pull request to the original repository

Please:

  • Follow the existing coding style
  • Test new features
  • Use commit messages that are meaningful and consistent in style with existing ones

License

TerminalSolitaire is a free software and its released under the terms of the GNU GPL v3 LICENSE file

About

Solitaire which you can run inside your terminal

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages