Well done! If you're here, then hopefully, you've programmed your first game. Now, let's see what you can do on your own to add some options. The first thing you should do is learn how to edit menus. You can do this by reading the pertinent part of Chapter 5 of our book...focus on learning how to add menus to your project. The menus you want to add look like those shown the following two images:
The code for the "File-->Start New Game" menu should be pretty straight forward. All you need to do is to call the cmdStartNew_Click sub routine! The code for the "File-->Exit" menu should also be really straight forward...you know how to do that!
However, the "Game" menu is a different story. "Game-->About" should be easy - all you need to do for that is to display a message box with a little information in it...no problem. The "Game-->Two Player" menu should be the default (e.g., it should be checked when you first go there). With that option checked, everything should work just like it does now. However, when you select the "Game-->One Player" option, some different things need to happen as this is the option that allows you to play against the computer.
I'm not going to give you too much information for this as I want you to think through how you should do this work...you can do it! I will suggest that using a Boolean variable called mblnOnePlayerGame to indicate when you're playing a One Player (e.g., against the computer) vs. Two Player game.
I'll also tell you that the computer really won't have any strategy...it will just pick a random open grid position in which to place his mark. In order to do this, you'll need to know how to generate a random number between 0 and 8. Here's the code for making a random move.:
Let's take a look at this routine. The first thing to notice is that it is a "function" and not a "sub routine." What does that mean? Think about what a function does in math...it returns a value, right? It's basically the same thing here. When you call this function, you will do it like this:
intComputerPick = MakeRandomMove
This will run the function and place the results into the integer variable intComputerPick. Neat, huh?
I'm going to leave everything else up to you...good luck (I'm sure you can do it!)!