A game called "Cats and Dogs" programmed long long ago
Posted: Sat Oct 04, 2025 1:22 am
A few months ago, I programmed a game that implemented "Cats and Dogs" as shown in Math Games with Bad Drawings - 75 1/4 Simple, Challenging, Go-Anywhere Games—And Why They Matter.
The premise is this: You and an opponent represent cats and dogs in a race to claim more territory. You play on a grid. Cats go first, then alternating. Once a cat is set on a grid square, a dog can't be 1 square away from the cat (including diagonals). Whoever claims more territory in the end wins.
My implementation is a bit crude, but it should work on all OSes
.
Source Code
Compilation: use g++ (Linux/MacOS)/MSYS2 (Windows) for compilation. stdc=17.
The premise is this: You and an opponent represent cats and dogs in a race to claim more territory. You play on a grid. Cats go first, then alternating. Once a cat is set on a grid square, a dog can't be 1 square away from the cat (including diagonals). Whoever claims more territory in the end wins.
My implementation is a bit crude, but it should work on all OSes
Source Code
Compilation: use g++ (Linux/MacOS)/MSYS2 (Windows) for compilation. stdc=17.