Sunday, April 26, 2009

assignment I

have a bath
##########################
human instruction
open geyser to boilwater
take a bath
dry body
####################
computer instruction
function boilwater
with geyser
set up the temperature
turn geyser.switch to "on"
when geyser.temple = 50
execute function have a shower
function take a bath
place body in bath
open geyser tap
if all body be covered by water = yes
turn off geyser tap
start counting time
if time = 15min
execute function dry body
function dry body
desiredbodyhumidity = 5%
desiredglobonskin = 0
get body out of bath
use bath towel wipe body
if desiredbodyhumidity > 5%
execute function dry body
if desiredglobonskin > 0
execute funcion dry body
else:
finish

1 comment:

  1. Nice. I guess you can clearly see how the lack of identation makes the necessary hierarchies of the code disappear. Python relies heavily on identation, keep that in mind!

    ReplyDelete