STL and Chess and bitset

Started by
0 comments, last by JohnBolton 19 years, 2 months ago
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.
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.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

This topic is closed to new replies.

Advertisement