One method I thought of for storing chess positions is a stack. This is because when you go one move deeper in the search, you add that position onto the stack, and delete the node when finish, this way it is easy to take back a move. My engine stores positions as a constant class, so taking back moves would be difficult. Would storing in a stack make sense?

  • 1
    A stack is a natural way of doing say minimax algorithm interative deepening search of a search tree.
    – qwr
    Commented Jul 27, 2022 at 1:26
  • 1
    You are familiar with chessprogrammingwiki right? they probably have that answer there
    – qwr
    Commented Jul 27, 2022 at 1:27
  • It makes sense for someone. But you don't say for whom, or in what context. It may make perfect sense as an illustration of object-oriented design for beginners. It may make no sense at all for someone who only cares about nodes per seconds. Or it may ... try it, then evaluate it critically from all points of views that matter. Then answer the question yourself.
    – user30536
    Commented Jul 27, 2022 at 19:04


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.