i.ZAHIR
Loading0%
Back to Projects

Checkers Game

A desktop Checkers game built in C with a GTK+ graphical interface, featuring single-player AI, two-player, and AI vs AI modes.

2023

Duration

Mar 2023 – May 2023

Contributors

2 contributors

Technologies

4+ tech

CG

Checkers Game

Project Overview

Developed as a systems programming project, this desktop Checkers game is built with C and the GTK+ graphical toolkit. It implements the full Checkers ruleset with multiple play modes: single-player against an AI opponent, two-player on the same machine, and an AI vs AI spectator mode. The AI uses a minimax algorithm with varying depth for difficulty scaling.

Features

  • Classic Checkers gameplay with full rule enforcement — captures, kings, and forced moves
  • Single-player mode against an AI opponent
  • Two-player mode for competitive local play
  • AI vs AI spectator mode for automated gameplay
  • Varying AI difficulty levels using minimax with adjustable search depth
  • Rich GTK+ graphical interface with board rendering and piece animations

Challenges

  • Implementing a correct and complete Checkers rule engine in C
  • Building a minimax AI that remains responsive at higher difficulty levels
  • Rendering an interactive game board with GTK+ drawing area and event callbacks

Solution

Modeled the board as a 2D array with bitfield flags for piece state. Minimax with alpha-beta pruning keeps the AI responsive at deeper search depths. GTK+ drawing area widget handles all board rendering with mouse event callbacks.

Architecture

Single-process desktop application. A game state struct holds the board, current turn, and scores. GTK+ event callbacks mutate game state and trigger redraws. The AI module runs minimax independently and returns the best move.

Results & Impact

  • Fully playable Checkers game with all standard rules enforced
  • AI provides a genuine challenge at higher difficulty settings
  • GTK+ interface delivers a native desktop experience on Linux
Technologies

Frontend

GTK+

Backend

C (game logic, AI)

Database

Tools

GCCMakeGit
License
MIT

Free to use, modify, and distribute with attribution.

Project Tags
CGTK+AlgorithmsData Structures

More Projects

ngx-auth-client
2026Current
A published npm package that exposes Angular authentication as signals instead of getters, ships a Keycloak adapter behind a provider-agnostic port, and keeps tokens out of localStorage entirely.
AngularTypeScriptKeycloak+6
ngx-api-client
2026Current
A published npm package extracted from the same api.service.ts I had copied across four Angular projects — configurable versioning, RFC 9457 error normalization, retry with backoff, and zero UI dependencies.
AngularTypeScriptRxJS+5