Today, I wanted to mess around with something totally different – horse racing, but with a twist. I’ve always been a fan of those old-school arcade games, so I thought, “Why not try to build a super simple ‘war horse racing’ game?” No fancy graphics, just pure, basic mechanics.

Getting Started
First things first, I needed a way to represent the horses. I figured the easiest approach would be to just use text. Each horse could be a simple string, like “Horse A”, “Horse B”, and so on. I decided to make them into strong tags so they stand out a little.
- Horse A
- Horse B
- Horse C
Then I thought about the “track”. I simply used a bunch of underscores () to show the distance. The more underscores, the longer the track.
Like this, you know?
Making the Horses Move
The core of the game is, of course, making the horses move. I needed some way to randomly advance each horse. It’s like giving each horse a little nudge forward, but the nudge amount is different each time.
I did this with a simple random number generator, nothing difficult at all. Every “turn”, each horse gets a random number, and that number determines how many spaces they move forward on the track. I decided that each horse can move at most 5 steps at a time.

Showing the Race
To make this game display the way I wanted, I needed to put all the horses and the current distance on the same line, so I had to get all the current data and print them out at once.
After each “turn”, I cleared the previous positions and redrew everything. This gives the illusion of movement. Just like those flip-book animations you made as a kid!
So, after a few “turns,” it might look something like this:
- _______Horse A__________________________
- ____________Horse B_____________________
- ____Horse C_______________________________
The Finish Line!
The game keeps going until one of the horses crosses the finish line. I just check, after each turn, if any horse has reached or passed the end of the track. Whoever makes the distance first wins!

When a horse wins, I simply print a message like, “Horse B wins!”. Very straightforward.
It’s simple, it’s text-based, but it was a fun little experiment!