to lower-magnet
b, on thatway
end
to raise-magnet
b, on thisway
end
to initialize
a, setpower 2
b, setpower 8
end
to Whirl-A-Carbon
loop [waituntil [(switcha)] a, on
waituntil [(switchb)] a, off]
end
to crane
loop [if switcha [lower-magnet]
if not switcha [b, off]
if switchb [raise-magnet]
if not switchb [b, off]]
end