← All projects

Games

Othello

Rewrite of a game from my studies: C engine (rules, minimax alpha-beta AI), playable in the browser through WebAssembly.

Done Sprint S17-S18 · 8 points
In short, no jargon for non-developersRead the summaryClose
What it is
The game of Othello against the computer, playable in the page.
What it is for
A game from my studies, rewritten from scratch with the methods of a professional project: automatic tests, versions for several systems.
What it shows
An artificial opponent that thinks several moves ahead, and a fast program whose every rule is checked.
Source code

How the pieces fit together

Diagram: Perft → Engine (checks the rules) ; AI → Engine ; Engine → WebAssembly (built by Emscripten) ; WebAssembly → Project page (game, undo). checks the rules built by Emscripten game, undo Engine C, two bitboards Perft reference counts AI alpha-beta negamax WebAssembly Emscripten, 4.5 KB Project page mouse, touch, keyboard

Play against the AI

The project's C engine and AI, compiled to WebAssembly (4.5 KB), run in your browser. Dots mark the possible moves.

I play

Loading the engine…

With the keyboard: arrows move the active square, Enter or Space plays. Level and colour apply to the next game.

Tech stack

  • C
  • CMake
  • Emscripten
  • Unity

Who does what

C
The engine (board as two 64-bit integers, moves computed by bit shifts) and the alpha-beta AI.
CMake
Building and testing with GCC, MSVC and Clang, warnings as errors, with ASan and UBSan.
Emscripten
Compiles the engine and the AI to WebAssembly: you play the AI on the project page.
Unity
Tests of the board (perft up to 8 moves, against the published counts) and of the AI.

Definition of Done

  • Code reviewed, diff by diff
  • Unit and integration tests green
  • Green CI on Linux, Windows and macOS when compiled
  • README, REVIEW.md and DECISIONS.md up to date
  • Texts in French and English
  • Demo deployed and tested on mobile