Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Compound Condition: Difference between revisions

From Groundhog Learning
Updated via bot
 
(No difference)

Latest revision as of 15:53, 21 October 2025

A condition that combines two or more simple conditions.

Details

Allow program to make decisions based on multiple criteria at once.

AND Condition

🤖 Pseudocode

if hasEnoughMoney AND hasInventorySpace # true if both conditions are true
    player can buy the item

OR Condition

🤖 Pseudocode

if hasShield OR isInvincible   # true if either condition is true
    player don't take damage

NOT Condition

🤖 Pseudocode

if NOT doorIsLocked     # true if condition is false
    player can enter

Related Concepts

Related Actions