![]() |
| | #1 |
| Registered User Join Date: Apr 2007 Location: india->tamil nadu
Posts: 18
| i have created a number based game called 'numfun'. it is a very simple game of course. firstly ther is a buffer array 4x4(level 1). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 * the 16th square is blank represented by a *. i use another array 4x4, in which all the numbers have jumbled positions say 1 4 8 6 7 3 10 14 * 11 9 2 12 5 13 15 the user has to move numbers into the empty '*' location and finally approach the positions of buffer array. the game works perfectly fine, but the thing is i am trying to upgrade it with an AI engine. i have few idea for construction of the AI engine and i need some help. thanks in advance..
__________________ -------------------------------------------------------------------- "Quotes don't make a man great- deeds do..." |
| cyb3r is offline | |
| | #2 |
| Registered User Join Date: Jan 2009
Posts: 2
| tips You can use something like this one. states are game states. llike the grid you want to solve operations look like state operation(state ) and are for example "rook goes to e,3" ... Code:
data structures {
states already solved
states to be solved
}
code {
add first state to to be solved // EDIT: the one you want to solve
until to be solved != empty
pop first
apply each operation // get new state
if solution // you have to know how to recognize solution
done and done ;)
if not in already solved
add to already solved
add to to be solved
}
Last edited by hribek; 01-26-2009 at 01:21 PM. Reason: forgot about something |
| hribek is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Looking for coder: Simple C++ Client / Server game | kocho | Projects and Job Recruitment | 1 | 02-04-2006 02:34 PM |
| Game Engine Link Prob | swgh | Game Programming | 2 | 01-26-2006 12:14 AM |
| Simple driving game | Bubba | Game Programming | 6 | 07-06-2004 09:34 AM |
| Help with a simple game | jjj93421 | Game Programming | 1 | 03-28-2004 03:52 PM |
| Resource ICONs | gbaker | Windows Programming | 4 | 12-15-2003 07:18 AM |