Sign in to follow this  

STL and Chess and bitset

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

This topic is 4689 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this