Page 1 of 1

A game called "Cats and Dogs" programmed long long ago

Posted: Sat Oct 04, 2025 1:22 am
by Jeff Calc 84
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.

Re: A game called "Cats and Dogs" programmed long long ago

Posted: Sat Oct 04, 2025 6:24 am
by Sumde
Thanks for sharing your game Jeff Calc! I've tested it out and I have to say this is a pretty neat game :) Also a neat use of <vector>, as I haven't seen that in a long time :lol:

This also feels like a game that you could implement into a gui program! So that you can play graphically instead of (idk, maybe "terminally" is what it's called?) Unfortunately I did find a couple of bugs that could be fixed, like how when you set the width to 4 and the height to 7, 1G, 2G, 3G, and 4G are filled up with O's. But overall this seems like a pretty good game, 9/10! :D