ChessPlusPlus progress

Pages: 123... 5
The old thread is archived, so I can't post to it anymore:
http://www.cplusplus.com/forum/lounge/98693/5/

I've been steadily working on ChessPlusPlus for the past months, which has been quite challenging since for months I've not been able to link the executable for various reasons, only able to compile the source.

Finally though, I've got it working - and surprisingly I didn't need to make that many modifications to fix things I wasn't able to test while coding in the dark.

Here's a screenshot of it:
http://i.imgur.com/jaSMbDr.png


The bottom queen is selected, and my mouse is hovering over the top-right piece. Filled squares indicate places that piece can move, hollowed squares indicate places that piece can capture. (Some pieces can only move in certain places and only capture in other places - the code is designed around this).

That's about it in terms of functionality - I still need to implement moving the pieces and capturing, and then a few other things (like Castling and whatever rule it is that lets you add queens). But I must say I am extremely happy that this works, after not being able to test the code I've been writing for months until just now.

The official repo (which doesn't match up to what you see in that screenshot) is here:
https://github.com/cpluspluscom/ChessPlusPlus
I recommend using the cmake branch (it's not merged since there are still a couple issues)

My repo (which matches up to what you see in that screenshot) is here:
https://github.com/LB--/ChessPlusPlus

You can build with CMake and nuwen MinGW 4.8.1, then run the generated executable from the root directory so it knows where to find the res folder (or run it from anywhere else as long as it is in the same directory as the res folder).

As for the code itself, the goal has been modularity. As such, I have a demonstration Archer piece class (but no graphics, configuration, or factory for it). Eventually all logic will be serverside and all rendering will be clientside, but that's a far-off goal.
Last edited on
I've done some more work and you can now move pieces and take turns!

http://i.imgur.com/J92o4HV.png

Still no victory conditions yet.
closed account (Dy7SLyTq)
huh i thought this was dead. i would love to help out in my spare time
I don't understand the highlighting. It doesn't seem to reflect legal moves.
closed account (Dy7SLyTq)
the second pic does. it doesnt seem to take in to consideration when a piece is blocked by one on its own team
it doesnt seem to take in to consideration when a piece is blocked by one on its own team


Oooooooh. Yeah okay that explains it.
Heh, I don't play chess. I keep referring to Wikipedia for info on how chess works and obviously you can tell that I've allowed impossible movements by mistake :p but it was good for demonstration purposes since I couldn't move the pieces when I had taken that first screenshot.
Last edited on
closed account (Dy7SLyTq)
no problem. im sure that the people on here will audit or "write" the moves.
Yeah, but I've got get the already coded ones working as intended. I'm trying to fix en passant and it's causing me some issues because even though I planned for it in some places I didn't plan for it in others.
closed account (Dy7SLyTq)
i havent looked at the code, but you cant do as a general move and then pass the current space to it?
My latest commit has working en passant! This was quite a bit more challenging than I anticipated, because months ago I had planned the perfect way to do it and then forgotten it afterwards. I've got that perfect way back now :)
like Castling and whatever rule it is that lets you add queens
I remember that discussion about Strategy pattern :)

Looks like I made a mistake for not checking it earlier. I should definetly look into it when I will have free time.

Is there anything need fixing, which you do not work with, so we will not cause conflicts if I decide to change that?
I'll be glad to have some help! :)

In Debug.hpp, the timestamp code that Thumper wrote doesn't place zeroes before single digit times (so you get 1:2:3 instead of 01:02:03). It should be a simple fix but I don't know how to do it.

Also, git is very good about avoiding merge conflicts (and I'm very good at resolving merge conflicts) so you shouldn't worry too much about that.

You can either for the cpluspluscom repo or my repo, commit the changes to your fork, then send a pull request to mine or the official repo depending on which one you forked.
Last edited on
wow is that still going? how is the progress? nearly finnished?
Err... Is there any easy way do get directories which linked to another repos as well? I'm trying to setup IDE to work with it and I missing json parser library.

Also: git will not push any new files unless you tell him to add these files, right?

And I noticed, that we are using Boost. Do any modules which require compiling are used here?
MiiNiPaa wrote:
Err... Is there any easy way do get directories which linked to another repos as well? I'm trying to setup IDE to work with it and I missing json parser library.
IIRC run
git submodules init lib/json-paser
then
git submodules update lib/json-parser


Also: git will not push any new files unless you tell him to add these files, right?
Right, add then commit then push.

And I noticed, that we are using Boost. Do any modules which require compiling are used here?
The project links to boost_system and boost_filesystem.
Usually after I've finished work for a commit, I git status to see what I've changed, then I git add *.*pp && git status to add all cpp and hpp files, then I deal with remaining files by hand.
@LB
I pushed a commit to cpluspluscom/ChessPlusPlus cmake branch to do what you wanted with the timestamps.
I felt the need to do a small contribution when I've been absent for so long.
Hopefully I'll have some free time to pound out some serious work in the near future.

Hope you guys are taking care!

EDIT:
Also, when I get some time there will be some CMakeLists.txt modifications that I need to make for clang/OS x support.
Last edited on
Ah, that might mess with what MiiNiPaa is doing - I'll resolve any issues. EDIT: I think there's a better way to do it than what you came up with, but I'll wait for MiiNiPaa's solution.
EDIT: Thumper will be using http://en.cppreference.com/w/cpp/io/manip/put_time which I think is the most correct way to do it.

Don't feel like you're not helping - you did a lot of work on the original base of the code and shaped the project, I just extrapolated your work and made it modular. If you had for instance not used classes I probably would never have contributed to the project.


Also, @Disch is this your account?
https://github.com/Disch
https://github.com/LaurentGomila/SFML/issues/58
http://en.sfml-dev.org/forums/index.php?topic=2480.0
I'm pretty sure it is, but if not, I'd better remove it from the cpluspluscom owners team :S
Last edited on
I had returned home only to see that Boost compilation is not finished because cc1plus.exe had crashed. I found out that it is the common problem when using gcc. So I have either to click out all those messages that program had crashed or abort compilation and exclude boost::math from compile list. I think I will go for second and set it to compile overnight.

I have made changes to class and made a pull request.

EDIT: put_time isn't supported by gcc. Looks like it is better migrate to clang.
Last edited on
Pages: 123... 5