< Previous | Contents | Next >

Introducing the Tic-Tac-Toe 2.0 Game

The project for this chapter is a modified version of the project from Chapter 6, the Tic-Tac-Toe game. From the players perspective, the Tic-Tac-Toe 2.0 game looks exactly the same as the original because the changes are under the hoodIve replaced all of the references with pointers. This means that objects such as the Tic-Tac-Toe board are passed as constant pointers instead of as references. This has other implications, including the fact that the address of a Tic-Tac-Toe board must be passed instead of the board itself.

You can download the code for the new version of the program from the Course Technology website (www.courseptr.com/downloads). The program is in the Chapter 7 folder; the filename is tic-tac-toe2.cpp. I wont go over the code because most of it remains the same. But even though the number of changes isnt great, the changes are significant. This is a good program to study because, although you should use references whenever you can, you should be equally comfortable with pointers.