All pastes #210073 Raw Edit

Unnamed

public text v1 · immutable
#210073 ·published 2006-10-19 14:24 UTC
rendered paste body
View.Set ("graphics:max,max")
var num : int := 4
var x, y : array 1 .. num of int
var mx, my, mb : int
var circleCount : int := 0

mousewhere (mx, my, mb)

for i : 1 .. upper (x)
    x (i) := my
    y (i) := mx
end for

loop
    mousewhere (mx, my, mb)
    loop
        mousewhere (mx, my, mb)
        if mb = 1 and circleCount = 0 then
            drawfilloval (mx, my, 5, 5, blue)
            circleCount += 1
        elsif mb = 1 and circleCount >= 1 then
            drawfilloval (mx, my, 5, 5, blue)
            drawline (x (2), y (2), mx, my, red)
            circleCount += 1
            exit
        end if

    end loop
    for decreasing i : 4 .. 2
        x (i) := x (i - 1)
        y (i) := y (i - 1)
    end for


    x (1) := mx
    y (1) := my

end loop