If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Compound Booleans with logical operators

Problem

A game programmer uses this nested conditional in their online Four Square game.
IF (mouseX < 200 AND mouseY < 200) { 
    currentSquare ← 1
} ELSE {
    IF (mouseX > 200 AND mouseY < 200) {
        currentSquare ← 4
    } ELSE {
        IF (mouseX < 200 AND mouseY > 200) {
           currentSquare ← 2
        } ELSE {
            IF (mouseX > 200 AND mouseY > 200) {
                currentSquare ← 3
            }
       }
    }
}
When mouseX is 173 and mouseY is 271, what will be the value of currentSquare?
Choose 1 answer:
🤔