Login

It's Free!

Who's Online

11 Guests Online
6 Users Online

Related Tags

None found

 
 post new topic

Storing moves

Related Forum Topics:
adding memory to help performance of chess...
Move generator
Crafty Move List
Crafty Move List
CPU/memory..and speed of CB8
Fritz 7 - memory leak?


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 ?.
  | | | post reply
re:Storing moves - 2007/01/25 23:26 You can allocate container for moves that uses LIFO policy static Move allMoves[1024];

And then
Move *top = GetTop(allMoves);
int moveCnt = gen.genMoves(side, top);
SetTop(top + moveCnt);

Before return do

SetTop(top);.
---------
Liberty exists in proportion to wholesome restraint.



  Popular posts by Elder Turtle
New Chess Ladder Freeware almost re...
A Crime by a Board of Old Impost...
Position with the greatest numbe...
  | | | post reply
re:Storing moves - 2007/01/25 23:58 remember the following:

http://www.rescon.de/Compu/schachzahl2_e.html (eng/ger)

comparably showing which positions exist with a lot more of moves..
---------
Disclaimer: These opinions are my own, though for a small fee they be yours too. - Dave Haynie



  Popular posts by HowiePhan77
CPP related question on double code...
Fischer Random Chess is not bori...
  | | | post reply
re:Storing moves - 2007/01/26 01:01 Usually and in fact this position causes trouble in each the proghrams
I surreptitiously tried it..
---------
If you are going through hell, keep going.



  Popular posts by claude415
TRY THIS MATE IN FOUR WITH YOUR ...
Fritz
  | | | post reply

Related Products:
   3-in-1 Teakwood Game Table With 2 Drawers For Storing Pieces
   Bobby Fischer's Outrageous Chess Moves: A Study Of 101 Outrageous Move...
   First Moves

© 2008 ChessCircle
Joomla! is Free Software released under the GNU/GPL License.