If
If sentences lets me examine one or more circumstances, and then acting in different way, depending on whether the circumstances fullfill some needs or not. An example:
(somebody fired at (x,y)) if there's a ship on (x,y) decrease the number of fields in this ship by 1 write "Smack!" else write "Plop"
Concept last updated: 24/09 2003.
Relations
|
Other sources
- Diverse opgaver - Selektion
- Eksempler på programmerings-sprog - If
- Start på Javascript 1.5; Jes Nyhus; 1.udgave (obl.) - 6. Betingede sætninger