Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connect Four Solver Python

A Python Connect Four solver using a compact bitboard representation, negamax search, alpha-beta pruning, move ordering, and a transposition table.

Features

  • 7x6 Connect Four bitboard board representation
  • Exact and weak solving modes
  • Alpha-beta negamax search
  • Transposition-table bounds and best-move storage
  • Center-first move ordering with tactical scoring
  • CLI tools for solving entered positions and running benchmark positions

Files

  • board.py - board state, bitboard masks, move generation, and win detection
  • solver.py - negamax solver
  • transpositionTable.py - simple in-memory transposition table
  • main.py - interactive position solver
  • test.py - benchmark/test runner for files under tests/

Usage

Run the interactive solver:

python main.py

Enter a move sequence using 1-based columns, for example:

4455

Run a benchmark file:

python test.py

Then enter one of the test filenames from tests/, such as Test_L1_R1.

License

MIT License. See LICENSE.

About

Python Connect Four solver with bitboards and alpha-beta search

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages