Quote: "my solution, 7 Queens must die "
Quickest solution ever
Quote: "Does the grid keep growing or is it a fixed size?"
The grid itself is fixed in most games
Quote: "Ok how about this;
As you add each piece you flag a 2d array (representing the board) of each square that cannot be occupied.
If the computer has to move then pick a unflagged square.
If the user moves they cannot select a flagged square
The game is over when you have flagged squares = total squares"
That's basically what the algo does
There is just one player
Quote: "I think i get it. If they place a queen on the grid you are trying to see if there's a possible solution is that it?"
The queen problem is about how to place 8 queens on a chessboard so they can't take each other, and how many possible solutions there are.
It's basically a 1 player game
Quote: "*edit*
There are 92 possible solutions to the 8 queens problem on an 8x8 grid. I would put them in an array and depending on where the player places a queen you could filter out the possibilities."
It's a one-time real-time problem
I just wanted to see if recursion can be used in AppGameKit on a 'deep' scale, meaning if AppGameKit can do a deep recursive evaluation of all possible moves up to a certain depth.
The algo I'm gonna use is called Negamax with alpha-beta pruning. It basically goes through all possible positions on any game board with a set depth.
You can see how it works here:
https://en.wikipedia.org/wiki/Negamax#/media/File:Negamax_AlphaBeta.gif
So there is no precalculation, there is only real-time calculation.
The sole purpose of the 8 Queens Problem was to see whether AppGameKit ( being an interpreter ) is fast enough to do this or not.
The main reason I'm doing this is a project I once started in Blitz3D. It's a 4-in-a-row game with different opponents ( total beginner, expert, drunk guy, and so on ).
I want to port the algo to AppGameKit and finish the game.
Cheers,
PSY