Simplifying Boolean Expressions |
Here are some examples of code that make me cringe. Can you figure out how to simplify them?
if ( box.contains( point ) ) then { // do nothing here } else { counter := counter + 1 }
if (box.contains( point )) then { boxGrabbed := true } else { boxGrabbed := false }
if ( boxGrabbed == true ) then { ... }
while { done == false } do { ... }
Simplifying Boolean Expressions |