Jump to content
  • Advertisement
Sign in to follow this  
tiagocc0

Othello / Saving Boards / Hash Table

This topic is 4516 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I´m doing a othello game with minimax, i was thinking if there is a way to store a board, without doing piece by piece, so i can check if another board is the same as the one i saved, and then i would save those boards into a hash table, but i don´t know much about hashing.. Anyway, if there is a way to store the board except being it to store each piece at a time, it would be a lot easier. I did a matrix to store the boards, its like the Y represents how much pieces are on the board and the X how much white pieces are on the board, so it would be easier to tell the apart, but even so in a 4x4 board there some positions of the matrix that store 500 to 1000 boards making it slower than if i didnt try to locate those nodes that i already calculated. Thank you for your attention..

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Othello is played on a 8x8 board, 64 tiles total. You can use a 64-bit number to encode where all black pieces are. Another 64-bit number stores where all white pieces are. You can then use some well-known hashing algorithm to hash the full 128-bit number (which represents the game situation) into desired range, e.g. 0-9999 for a hash table with 10000 elements.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Also: http://en.wikipedia.org/wiki/Hash_table

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!