Variables for Relational Operators?
in
Programming Questions
•
1 years ago
Is it possible to use a variable to flip between "<" and ">"?
I'm making a chess environment and pieces are stored as positive numbers for white and negative for black (white pawn is a "1" and black pawn is a "-1" for example). I have a long series of conditional statements that make a list of possible moves for an AI to use and it set up at the moment for black. If I could just flip all the ">" to "<" in the statements during white's turn it would still correctly make a list of possible moves for white as well.
1