Monday, October 4, 2010

Guess the distance

clg
color yellow
rect 0,0,300,300
x1=rand*300
y1=rand*300
x2=rand*300
y2=rand*300
color red
circle x1,y1,4
color blue
circle x2,y2,4
Print "What is the distance between the points? "
input " " , s$
print ((x2-x1)^2 + (y2-y1)^2)^0.5

No comments:

Post a Comment