Java toggling value of boolean not working -
I am trying to toggle the boolean playerTurn
to allow methods to control However, this is not working, the methods will not be transferred, nor will print any other print statement. {PARTIAL ZERO ACTION ACTION (ACTION AE) {DISEAST () • Private Boolean player Turn = true; if (player current == true) {moveC1Up (); FirstPanel.Repent (); System Out.print (DysRol); System Outprint ("Counter 1 Transfer"); PlayerTurn =! PlayerTurn;} and if (player turn == incorrect) {moveC3Up () ; First paneel.print (); system.out.print (dicrrol ()); system.out.print ("transfer to counter 3 "); Plaarturn =! Plaarturn;}}});
This is your action:
- I
- This is my turn!
- Yes, this is my turn, so I go up and repaint, and this is not my turn
- I get out
and Still the same ... something is wrong ... the second can never be executed.
Use the debugger and analyze how the program is working, what you see from it.
Comments
Post a Comment