Algorithms For Robot Making Tea
Algorithms For Robot Making Tea
Algorithms
An algorithm is a sequence of steps designed to perform a particular task.
SEQUENCE
We must refine the algorithm in simple steps that are carried out once each
and in order:
1. Get tea-making equipment:
a. Open cupboard
b. Get cup
c. Get teabag
d. Close cupboard
e. Open fridge
f. Get milk
g. Close fridge
2. Put teabag in cup
3. Fill kettle from tap:
a. Place kettle under tap
b. Turn on tap
c. Turn off tap
4. Boil kettle:
a. Plug kettle in
b. Turn kettle on
5. Pour water into cup
1/2 Aquilina K.
Student Notes
DECISION MAKING
Algorithms generally have the ability to make simple choices as to what to
do:
if there are no teabags in the cupboard
then go out to the grocer and buy a packet
else put a teabag in the cup
REPEAT (LOOP)
Another common task of an Algorithm is to repeat a set of commands until
some condition is met:
2/2 Aquilina K.