global [x y]
to castle
initialize
forever [b, onfor 3 wait 5 rd onfor 3]
waituntil [switch 7] conveyor-belt
end
to conveyor-belt
belt onfor 25
waituntil [ or (switch 8) (switch 9)]
ifelse (switch 8)
[ifelse x = 8 [belt onfor 50] [die stop]]
[ifelse x = 9 [belt onfor 50] [die stop]]
waituntil [ or (switch 10) (switch 11)]
ifelse (switch 10)
[ifelse y = 10 [belt onfor 30] [die stop]]
[ifelse y = 11 [belt onfor 30] [die stop]]
wait 10
mawwiage
end
to initialize
setx (8 + random 2)
sety (10 + random 2)
print 100 * x + y
end
to belt
a,
end
to die
note 85 6 note 87 2 note 88 2 wait 3 note 73 2 wait 2
repeat 3 [note 92 1 note 91 1 note 92 1 note 91 1]
end
to mawwiage
note 75 6 wait 1 note 80 5 wait 1 note 80 3 wait 1 note 80 5
wait 5
note 75 7 wait 1 note 82 5 wait 2 note 79 3 wait 1 note 80 5 wait 7
note 75 5 wait 1 note 80 5 wait 2 note 84 2 wait 3 note 87 7 wait 2 note
84 5 wait 1 note 80 3 wait 2 note 75 3 wait 1 note 80 5 wait 3
note 82 5 wait 2 note 80 5 wait 7
end