All pastes #186039 Raw Edit

jamie!!!!!!!!!!

public text v1 · immutable
#186039 ·published 2006-09-29 14:27 UTC
rendered paste body
View.Set ("graphics:max,max")
var mx, my, mb : int  % mouse
var sprayx, sprayy : int
var col : int := 0
var maxdist : int := 0
var distance : int
% sqrt ((x2-x1)**2 + (y2-y1)**2)
function dist (mx, sprayx, my, sprayy : int) : int
    result round (sqrt ((mx - sprayx) ** 2 + (my - sprayy) ** 2))
end dist

loop
    mousewhere (mx, my, mb)
    randint (sprayx, mx - 25, mx + 25)
    randint (sprayy, my - 25, my + 25)
    randint (col, 1, maxcolour)

    if mb = 1 and dist (mx, sprayx, my, sprayy) < 20 then
             drawdot (sprayx, sprayy, col)
    end if
    exit when hasch
end loop