var x1, y1, x2, y2, x, y,x9, button, x3, x4, mouseX, mouseY : int
x1 := 10%x-cordinate for left side of the box 1
y1 := 30%y-cordinate for left side of the box 1&2
x2 := 83%x-cordinate for right side of the box 1
y2 := 60%y-cordinate for right side of the box 1&2
x3 := 100%x-cordinate for left side of the box 2
x4 := 180%x-cordinate for right side of the box 2
x9:=1
loop
drawbox (x1, y1, x2, y2, black)
locate(23,14)
put" Button 2"..
drawbox (x3, y1, x4, y2, black)
locate(23,3)
put"Button 1"..
Mouse.Where (x, y, button)
if button not= 0 and x >= x1 and x <= x2 and y >= y1 and y <= y2
then
delay(100)
cls
locate(x9,1)
put "star"
elsif button not= 0 and x >= x3 and x <= x4 and y >= y1 and y <= y2
then
delay(100)
cls
locate(x9,1)
put "moon"
end if
end loop
|