Questions for Chapter 3
1) What action(s) does a function perform that a method does not?
2) What type of value is returned by each of the following built-in functions: a) distance to,
b) is within threshold of, c) is wider than, and d) width?
3) What are the four operations that can be used in a math expression in Alice?
4) List four different control structures used in creating a program in Alice.
5) What type of function value is used to check a condition in an If/Else statement?
6) Describe what happens in an If/Else statement when the instruction in the Else part is Do
Nothing?
7) The following relational operation is available in the World’s function list: a <= b. Give
an example of what “a” and “b” can represent. What type of value is obtained when this
operation is evaluated?
8) What is the purpose of a Loop statement?
9) Alice does not have built-in collision detection. a) What built-in function can be used to
detect when one object is too close to another? b) Give an example of an instruction that
uses the function to avoid collision.