Introduction
Hello. I’m writing this tutorial shortly after finishing a module in
AI at university. I’m basically gonna show u all the interesting bits
I learned, I’m sure none of you have any interest in hearing the long
debate about what intelligence actually is.
Before reading on, I would recommend that you make sure you are comfortable
using the following…
- Pointers to object, functions, and classes
- Classes
- Linked Lists.
- Creating objects using the ‘new’ keyword.
After you read through this, I would recommend you download the Zip that comes
with the tutorial, as copying and pasting code almost never works with programs
this large. In this tutorial, I’m going to use the single player game
“eight puzzle” as an example. The rules of this game are as follows.
There is a 3 by 3 grid containing numbers 1 to 8 (with 1 blank square). Initially
the numbers are arranged in no particular order. e.g.
The player can move the blank 1 space in the directions North, East South,
or West. On moving the blank, the space that the blank moves into moves into
the blanks old position. e.g. moving the blank north would result in the game
state looking like this.
The game is complete when the numbers are in the following arrangement.
This concludes the introduction. On the next page I will get into the different
ways in which this problem can be solved, and each methods advantage, and dissadvantage.