loop structures and booleans ( or ((not band )unlike arithmetichowevermost people don' tend to know or remember the precedence rules for booleans suggest that you always parenthesize your complex expressions to prevent confusion now that we have some boolean operatorswe are ready to return to our example problem to test for the co-location of two pointswe could use an and operation if getx(= getx(and gety(= gety()points are the same elsepoints are different here the entire expression will only be true when both of the simple conditions are true this ensures that both the and coordinates have to match for the points to be the same obviouslythis is much simpler and clearer than the nested ifs from the previous version let' look at slightly more complex example in the next we will develop simulation for the game of racquetball part of the simulation will need to determine when game has ended suppose that scorea and scoreb represent the scores of two racquetball players the game is over as soon as either of the players has reached points here is boolean expression that is true when the game is overscorea = or scoreb = when either score reaches one of the two simple conditions becomes trueandby definition of orthe entire boolean expression is true as long as both conditions remain false (neither player has reached the entire expression is false our simulation will need loop that continues as long as the game is not over we can construct an appropriate loop condition by taking the negation of the game-over condition while not (scorea = or scoreb = )continue playing we can also construct more complex boolean expressions that reflect different possible stopping conditions some racquetball players play shutouts (sometimes called skunkfor these playersa game also ends when one of the players reaches and the other has not yet scored point for brevityi'll use for scorea and for scoreb here is an expression for game-over when shutouts are includeda = or = or ( = and = or ( = and = do you see how have added two more situations to the original conditionthe new parts reflect the two possible ways shutout can occurand each requires checking both scores the result is fairly complex expression while we're at itlet' try one more example suppose we were writing simulation for volleyballrather than racquetball traditional volleyball does not have shutoutsbut it requires team to win by at least two points if the score is to or even to the game continues let' write condition that computes when volleyball game is over here' one approach