A HUMAN × MACHINE EXPERIMENTOPEN SOURCE. OPEN POSSIBILITIES.

Your move.Reimagined.

An open-source experiment in human × machine.
Connect Four, built in Python. Powered by AI,
computer vision, and voice.

Cobalt blue Connect Four board with sculptural red and yellow discs floating in a dark studio
FIG. 01 / A NEW WAY TO PLAY
6 ROWS. 7 COLUMNS. YOUR NEXT MOVE.
SCROLL TO EXPLOREBUILT TO THINK. MADE TO PLAY.
01 — THE NEXT MOVEPYTHON AT HEART. CURIOUS BY DESIGN.V. 0.5 ✳

You know the game.
Meet its next evolution.

A real board, a webcam, and an opponent that thinks ahead. Pefforza brings computer vision, search, reinforcement learning, and optional voice commentary into one Python project. Play in your terminal, on your desktop, or with a physical board.

Inside the project
THE ANATOMY OF A MOVEKEEP SCROLLING →
01 / PERCEPTION

First,
it sees.

Your board. Your table. One webcam.
Computer vision finds the grid and reads every red and yellow disc. The real world becomes a game state.

THE EYESOpenCV · HSV classification
Four-point calibration
COMPUTER VISIONILLUSTRATIVE VIEW
BOARD DETECTED7 × 6 / HSV CLASSIFICATION
INPUT REAL-WORLD BOARD→OUTPUT A DIGITAL POSITION
02 / INTELLIGENCE

Then,
it thinks.

Every move opens a new possibility.
Pefforza searches ahead, spots threats, and chooses its reply. Five difficulty modes. Five very different minds.

THE BRAINBitboard alpha-beta search
Exact solver · PPO neural policy
EXPLORING POSSIBILITIESSEARCH CONCEPT
RANDOMHEURISTICMINIMAXEXACTNEURAL
03 / INTERACTION

And the
game talks.

A move you can see. A reply you can hear.
An augmented-reality arrow points the way, while optional voice commentary keeps the conversation going.

THE CONNECTIONAR guidance · Voice commentary
Terminal · Desktop · Physical board
HUMAN × MACHINEEXAMPLE OUTPUT
↓COLUMN 04
“I’d play column four.”

Same intelligence.
Your kind of play.

Take the experiment off this page.
Clone it. Play it. Make it better.

PYGAME GUI

All the game. Zero setup drama.

A Pygame board, five AI personalities, and a familiar point-and-click game. No camera required.

Choose easy, medium, hard, impossible, or neural.
play_gui.pyPYTHON 3.10–3.13
# In your installed Pefforza checkout
❯python play_gui.py --difficulty hard
# Your next move starts here▌
First time here? Follow the installation guide
PYTHONOPENCVGYMNASIUMSB3

Think you’ve
got the edge?

One board. Two minds. No second guesses.
Drop your first disc and find out.

YOU / RED MACHINE / YELLOW

A little taste of Pefforza. This browser demo uses its own search opponent. Run the Python project for the full solver, neural agent, camera, and voice.

Meet the full engine
THE PLAYGROUND
You go first. Make it count.
Connect Four board
00 MOVES / 42

Choose a column. Connect four discs in any direction.
Keyboard: Tab to the board, then use 1–7 or Enter.