Intelligent Games Page
For week 7 we combined are knowledge of both AI and games to make intelligent game.
Number Guessing Game
On the first day of week 7 we had to make a program of a number guessing game below is the all the code and comments that explain it all.
One the second day we made a hangman game. For this program I used functional programming, which is when you slit your code into a bunch of functions. This is to help with debugging.
Tic Tac Toe
One the third day everyone was working on their hangman. Since I was already done I had time to start my tic-tac-toe program. So after 2 day of working on it I finished and got the code below (Explanation included).
This is the main code I used for the game.
This code is used for the computer to calculate its move. Right now it just tries a random empty spot, but soon ill make it more complex. In fact I could have made the AI some what better, if I did accentually deleted this code once and had to redo it.
This will draw the board with the current placement of X and Os.