All pastes #189803 Raw Edit

chris

public text v1 · immutable
·published 2006-10-03 13:24 UTC
rendered paste body
View.Set ("graphics:max,max")


function distance (x1, y1, x2, y2 : real) : real
    result round (sqrt ((x2 - x1) ** 2 + (y2 - y1) ** 2))
end distance


var midx : int := maxx div 2
var midy : int := maxy div 2
var mx, my, mb : int := 0


for i : 1 .. 5
    drawoval (midx, midy, i * 20, i * 20, red)
end for

var points : int := 0
loop
    mousewhere (mx, my, mb)
    if mb = 1 and distance (mx, my, midx, midy) < 5 then
        locate (1, 1)
        put "1000"
    elsif mb = 1 and distance (mx, my, midx, midy) < 20 then
        locate (1, 1)
        put "100"
    elsif mb = 1 and distance (mx, my, midx, midy) < 40 then
        locate (1, 1)
        put "80"
    elsif mb = 1 and distance (mx, my, midx, midy) < 60 then
        locate (1, 1)
        put "65"
    elsif mb = 1 and distance (mx, my, midx, midy) < 80 then
        locate (1, 1)
        put "30"
    elsif mb = 1 and distance (mx, my, midx, midy) < 100 then
        locate (1, 1)
        put "10"
    elsif mb = 1 and distance (mx, my, midx, midy) < 101 then
        locate (1, 1)
        put "0"
    end if
end loop