As I mentioned in previous questions I'm currently following this tutorial for building my chess engine.

The code was written in C#, but mine is in C++ and I'm in the phase of finalizing the board / piece / moves / valid moves representations without testing the logic just making sure the syntax is ok.

So I'm confused as to what should I do now, just continue writing without testing or there is a good way to test an incomplete chess engine?

Here you can take look at what I have done so far and your comments / recommendations are appreciated


I glanced at your code:

  • You should test your code with perft. Google it if you're not sure what it is.
  • Please make sure your code works before coding the engine search. If you unable to generate moves properly, nothing in your search will work.
  • Consider to use an array rather than a switch statement for piece values.
  • Consider to code your squares as an integer, not as a C++ class
  • Consider to collapse your WHITE and BLACK implementation together. C++ template would do that for you. Please take a look at Stockfish codebase if you're unsure.
  • I don't see you're making en-passant in the code. Are you sure you have that covered?
  • Thank you @SmallChess for your glancing . The third point is an performance matter right ? for switching the logic from enumerated BLACK and WHITE to template color why is it better and yes I ignored En-passant for now (to-do). – Hemed O.Khaled Jan 22 '18 at 2:40
  • @HemedO.Khaled Very important for you to add en-passant. The performance points are good but not critical for you right now. – SmallChess Jan 22 '18 at 4:57
  • 1
    @HemedO.Khaled Please consider accepting this nice answer if you feel it has covered your main concerns. – user929304 Jan 22 '18 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.