Login |  Register |  FAQ
Post new topic Reply to topic  [ 1 post ] 

game tree design problem

 Post subject: game tree design problem
PostPosted: Tue Nov 07, 2017 11:08 pm 

Joined: Tue Oct 03, 2017 4:40 am
Posts: 50
I have a tree node class, which holds a game board, and which can plot possible next moves, and functions which produce the next n rows of moves for a node. Each time a move is generated a new node is created, the game board is copied to this new node, and then the move is taken, leaving the original node's board untouched.

This however, is very slow. Is there a way that, perhaps using a static game board in the node class, I could just take moves as I create children, and then undo the moves as when returning to the original node. I keep a stack full of previous moves and can undo moves, but I'm not sure whether what I'm thinking of is possible since I would later need to search the tree and assess the board states, which would involve retaking the moves at each node. Another concern is whether this would even be any faster.

Any idea?

Please help.

I didn't find the right solution from the Internet.

References http://www.cplusplus.com/forum/general/34775/

whiteboard animation videos

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Powered by phpBB ® Forum Software © phpBB Group