Monday, June 8, 2009

Assignment 01 A Pseudo Code

for humans

boil the water
put rice in the water
wait 20 min

for computer

function boilWater:
with waterBoiler
fill with coldWater
if waterBoiler = full:
stop fill
turn waterBoiler.switch to „on“
when waterBoiler.switch = „off“:
execute function fillPot

function fillPot:
get pot
place pot right to waterBoiler
with waterBoiler:
move 30cm up
turn -90°
if pot = „full“
with waterBoiler:
turn 90°
move 15cm down
execute function makeRice

function makeRice:
desiredRice = 200
desiredTime = 20min
get rice
with rice:
place inside pot

start counting time
if time = 20min:
put pot in initial position
when waterBoiler.switch = „off“:
finish

No comments:

Post a Comment