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

Talk about C/C++, with C/C++ help, development, and tutorials for all your C/C++ needs!
Post Reply
User avatar
Jeff Calc 84
Cool Member
Posts: 32
Joined: Sat Oct 04, 2025 4:21 am
Location: Earth
Contact:

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

Post 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.
Working hard on Axe...
Me on Cemetech, Ticalc.
User avatar
Sumde
Site Admin
Posts: 21
Joined: Fri Oct 03, 2025 12:04 am
Location: Canada
Contact:

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

Post 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
Image
Post Reply