N-In-A-Row

Return to S2


You'll notice that all N-In-A-Row games involve the same algorithm(s) and I've basically done nothing more than rehash the graphics and a bit of gameplay for each one. This is a pretty good (but not the best) example of portable code. This code is also not documented. In fact, I didn't start heavily documenting my own code (no matter how small) until fairly recently. Still, it's a cakewalk to understand.

Tic Tac Toe (Source and Binary) (ASCII)
Get 3 in a row. For all of these games, 'enter' or 'space bar' normally places a piece and you use the arrow keys to move around. 'X' obviously goes first.
Connect Four (Source and Binary) (Allegro)
If anyone has read my other pages, you'll know that I've made this game before. Whereas before, it took me a few weeks to do up everything (including the graphics), this time around it has taken me...4 hours. I changed some of the gameplay mechanics to fit the style of connect four, but the code you know and love is still here. For those of you curious, the code upon which this is based only took me an hour. So 5 hours at the most. This isn't an accomplishment folks; this stuff is pretty easy. It only shows just how bad I was when I was a kid :-)


Five Stone Chess (Go-Moku) (Source and Binary) (Allegro)
Five Stone (Source/Binary) (ASCII)
My personal favourite of the bunch. You may think that Tic-tac-toe came first, but actually this was the one I made first. It takes place on a Go board, and the object is to get 5 in a row. I'm actually working on making a Go game and possibly tackling some of the AI problems that exist in the current computer science world for that game (as it is my all-time favourite RL game). I'll probably get to it after Tetris.




Examples provided require djgpp and Allegro graphics librarys to compile.
All examples are free to be copied, plagiarized, and distributed.
-Michael Raymond Vendittelli