Good afternoon, I am currently working on a project with a cobot that is going to play chess. I have already done the communication and data sending, however, the logic that I considered correct for its development is to use nested ifs. My logic is 1) evaluate if a move was made 2) evaluate if a piece was eaten in the move. Each specific move triggers a series of steps that are not equal. However, when the move eats the piece, it skips the if inside the nesting and executes the other lines of code, then, in the next move, it enters the steps to capture the piece. I am sending my code in polyscope so that whoever considers it has a better overview of the problem. Thank you very much in advance for your help.
I don’t see anything obviously wrong, but this is a case where putting some breakpoints in the program and stepping through line by line while watching the values of your variables will be extremely helpful. Tap on the line numbers to insert breakpoints. I would probably just put one on every line, since your program isn’t very long yet. As the program pauses on each line, you can flip to the Variables tab and see what the values are before the robot executes it. Could be that a variable is actually False when you thought it was True. This is how you catch those cases.


