Skip to content

Max0072/checkers-prolog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Checkers Game in Prolog

A text-based checkers game implementation written in Prolog with an interactive command-line interface.

Getting Started

Prerequisites

  • GNU Prolog installed on your system

Running the Game

  1. Open your terminal
  2. Navigate to the project directory
  3. Run: gprolog --consult-file checkers.pl

The game will start automatically and display the initial board.

Game Rules

  • White pieces are represented by '●' symbols, black pieces by '○'
  • Players alternate turns, with white moving first
  • Regular pieces can only move forward diagonally
  • Capturing opponent pieces is mandatory when possible
  • Pieces become kings (♛ for white, ♚ for black) when reaching the opposite end of the board
  • Kings can move in any diagonal direction

How to Play

Making a Move

  1. Enter piece coordinates in the format [row, column] (e.g., [6, 1].)
  2. Choose movement direction:
    • Type l or left to move left
    • Type r or right to move right
  3. Type q to quit the game at any time

Game Features

  • Automatic game end detection when a player has no valid moves or pieces
  • Highlighted movable pieces for each turn
  • Mandatory capture notifications
  • King promotion system
  • Input validation and error handling

Board Layout

The game uses a standard 8x8 checkers board with coordinates:

  • Rows numbered 1-8 (top to bottom)
  • Columns numbered 1-8 (left to right)
  • Only dark squares are used for gameplay

About

Game "checkers" in prolog

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages