Tutorial on Atoms added

Atoms command lineThis is my alternative approach to learning C. Show code, explain what it does in depth rather than explaining the C language feature-by-feature. I’ve created a 90 line skeleton program for atoms. The full file is on GitHub, The file is called atoms.c.

All this does is setup the board and let you enter your move. I’ve tested it on Windows and it calls _getch() to read the keyboard so it’s fast to enter moves and you don’t have to press enter/return. It then validates the move and updates the board and draws it. No chain reactions yet or computer play but those will be in future tutorials.

In the screenshot you can see I added one atom to (3,3) and then (5,6).

The board uses three characters for each cell with atoms prefixed by P or C for player and computer.  Trying to have the computer play well will be an interesting bit of programming.

 

(Visited 29 times, 1 visits today)