mynameisjonas
User
 Newbie
| Posts: 2 |   | Karma: 0
|
Storing moves - 2007/01/25 22:15
I'm programming an engine and I'm wondering if what I do concerning my list of move is somewhat efficient...
When generating moves or attacks, I need to store the moves in a list. Maybe I'll have to sort this list later also (I'm not there right now).
What I do right now is I allocate enough memory for lets say 100 moves, then I pass a pointer to this newly allocated memory to the generator. The generator then returns the number of generated moves..
Ex.: Move moveList[100]; int moveCnt = gen.genMoves(side, moveList);
This is not very memory efficient.. But we all know that it has to be fast...
How you guys proceed ? What containers are you using ?.
|