Hey guys, I need to learn how to use boolean in my work. But I just can't seem to figure out how it works. I know that the boolean variable determines a value if it is true or false only. But I don't know how to write it down or how it's use.
Can someone explain to me how this works? I mean how does the program know what the variable means to be able to determine if its true or false? And if I'm completely wrong, can someone run through the basics of the boolean variable for me?
1 2 3 4 5 6 7 8 9 10 11 | boolean checkTreeRight = false ; checkTreeRight = treeRight; checkTreeRight = true ; turnLeft(); move(); turnLeft(); checkTreeRight = false ; turnRight(); move(); turnRight(); |