I'm making a chess game using OOP C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

I'm making a chess game using OOP C++

The problem is it has too many if-else statements and apparently doesn't recognize the checkmate variable which stops the loop.Any suggestions and help would be useful! https://code.sololearn.com/ckIETr5ecdzB

3rd Jan 2019, 10:07 AM
Denis Cvetanov
Denis Cvetanov - avatar
7 Answers
+ 4
I think you're on a good way. Keep on! Maybe you'll find some Hints in the Chess Challenge. You may also take a look at my Chess Code. In your Code are some Points to review: Line 131: else if(x>x1&&y>y1){ if(y=y1){ How can y > y1 and y == y1 be true at the same Time? The Function checkMate is void and returns nothing. So what is the Purpose of the Variable _end? https://www.sololearn.com/learn/11610/?ref=app https://code.sololearn.com/cAM1YUq9RVQa/?ref=app
3rd Jan 2019, 7:24 PM
Sebastian Keßler
Sebastian Keßler - avatar
+ 2
I get compilation error on my phone, I don't know why?
5th Jan 2019, 5:18 AM
Xander Lim
Xander Lim - avatar
+ 2
I tried to run it on Cxxdroid. All Errors are related with the use of strcpy_s.
7th Jan 2019, 8:48 PM
Sebastian Keßler
Sebastian Keßler - avatar
+ 1
Sebastian thanks, i don't even know how i missed that😅
3rd Jan 2019, 9:42 PM
Denis Cvetanov
Denis Cvetanov - avatar
+ 1
I rewrote parts of it as advised by Sebastian, for now i'd be happy if it just works,but it gives me "use of 'end' is ambiguous' error. Gordie it sounds interesting and thanks for noticing the assignments( i guess i was really tired to do that :D ) , but I can't really imagine the code containing more classes in the moment, i need to think over how to implement them. Xander you can't compile it cause it still has errors and it depends on the way your compiler works. Still any advice is welcome !
5th Jan 2019, 8:47 PM
Denis Cvetanov
Denis Cvetanov - avatar
0
I've modified it again, but i still get the "use of 'end' is ambiguous in my main function...Anyone know why?
7th Jan 2019, 6:12 PM
Denis Cvetanov
Denis Cvetanov - avatar
0
Yes, it returns the same error on my online compiler, but visual studio requires it. I managed to clear all visible errors and it compiles, but there is no output, so I'll have to debug it step by step.. Tnx anyways, everything is welcome 😊
7th Jan 2019, 9:33 PM
Denis Cvetanov
Denis Cvetanov - avatar