Jump to content
  • Advertisement
Sign in to follow this  
Sagar_Indurkhya

STL and Chess and bitset

This topic is 5001 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

I started dabbling with bitboards, and wanted to ask you guys this: would using bitsets from STL decrease my speed? I mean, since I am an amateur programmer, I would like to use them as they are reliable, fairly optimized, and easy to use. Also, I could just use bitset<64> chessboard; What do you think? I only want to use them if their is very very little speed loss.

Share this post


Link to post
Share on other sites
Advertisement
My advice is to go with whichever is the most productive for you and worry about speed differences later.

Make your code more flexible up front by creating a BitBoard type. It will make it easier to change the implementation later. For now, just do this (if you decide to go with bitset).
    typedef std::bitset<64> Bitboard; 
When you have finished adding bit boards to your Chess player, then you can try different implementations to see which is fastest. Having a bit board type will also make it easier take advantage of 64-bit operations when they are available.

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!