#chess (first project)

8 messages · Page 1 of 1 (latest)

finite verge
#

finished freecodecamp's c++ course and felt like i could do anything.
welp this took me 12 hours over 4 days, which was way longer than i thought. anyways this has castling, en passant and stalemate.
playing this on main.cpp will give you headaches.

feel free to review the terrible code and maybe give me some suggestions as i move along

delicate hedge
#

you could definitely make board just deal with board things and have a Game class to deal with the state(s) of the game and the move stuff etc.

finite verge
#

sounds cool, so a board class for like just the array and a game class ]for everything else?

delicate hedge
#

i would also like to let you know that you could use named constants or other alternatives instead of using numbers and values from who knows where in your code.

#

especially the main function, I shouldn't really have to know what the if statement is checking for and all by going through the entire codebase or something right?

finite verge
#

so a a header file for constants where i could go like const int GAMEOVER = 0 and then while(board.getturn() != GAMEOVER) in my main, and then maybe more constants for the sides (white/black), char constants for the pieces and stuff like that to make my overall code more readable

delicate hedge