next up previous contents index
Next: Interact with the mouse Up: Receiving input from the Previous: Interact with the keyboard   Contents   Index

Some examples of usage:

to vintage
read [What is your age?] "age
make "age :age
if :age<18 [pr [you are a minor]]
if or :age=18 :age>18 [pr [you are an adult]]
if :age>99 [pr [Respect is due!!]]
end

to rallye
if key? [
	make "car readchar
	if :car=-37 [lt 90]
	if :car=-39 [rt 90]
	if :car=-38 [fd 10]
	if :car=-40 [bk 10]
	if :car=27 [stop]
]
rallye
end
# You can control the turtle with the keyboard, and stop with Esc


Loïc 2008-06-08