;; example1.txt ;; ;; Lego Robot Design Studio ;; ;; demo HandyLogo code for lecture 2: ;; beep, motors, switch, sensor, ;; waituntil, if, ifelse, or, and to double-beep beep wait 10 beep end to go-straight ab, on thisway end to go-backward ab, on thatway end to stop-motion ab, off end to turn-left a, off b, on thisway end to turn-right b, off a, on thisway end to fwd-til-bump go-straight waituntil [switch 7] stop-motion end to go-until-black go-straight waituntil [(sensor 0) > 100] stop-motion end to go-until-black2 go-straight waituntil [or ((sensor 0) > 100) ((sensor 1) > 100) ] stop-motion end to beep-if-pressed if (switch 7) [beep] end to double-beep-if-pressed ifelse (switch 7) [beep] [double-beep] end to beep-if-both-pressed if (and (switch 7) (switch 8)) [beep] end to beep-if-both-pressed if (switch 7) [ if (switch 8) [beep] ] end