Turtle and Observer Command

case variable  
[anything1 ilist1 
 anything2 ilist2] 

Checks if the first argument variable is equal to any of the anythings in the list. If it is equal, the corresponding ilist is executed and control skips to the end of the case statement. If nothing matches, no ilists are executed and control skips to the end of the case statement.

Example:

case temperature
[
"cold" [show "boy, it's cold!"]
"warm" [show "mmmm. nice."]
"hot" ["wow, it's hot!"]
]

Related commands: