All pastes #219038 Raw Edit

wutang - its yours

public text v1 · immutable
#219038 ·published 2006-10-24 14:00 UTC
rendered paste body
View.Set ("graphics:max,max")
var rollcount : array 1 .. 6 of int := init (0, 0, 0, 0, 0, 0)
var die : int
var mx, my, mb : int
var spot : int := 0

proc loadflashes (var flashes : array 1 .. 6 of int)
    for i : 1 .. upper (flashes)
        flashes (i) := Pic.FileNew ("flash" + intstr (i) + ".jpg")
    end for
end loadflashes
var flashes : array 1 .. 6 of int

loadflashes (flashes)
randomize
drawline (1000, 0, 1000, maxy, black)
drawfillbox (0, 0, maxx, maxy, 7)
loop
    mousewhere (mx, my, mb)
    if mb = 1 then
        spot := my div 100
    end if
    if mb = 1 and spot <= 6 and my < 500 then
        rollcount (spot) += 1
    end if
    delay (10)
    randint (die, 1, 6)
    rollcount (die) := rollcount (die) + 1
    Pic.Draw (flashes (die), rollcount (die), die * 100-100, picCopy)
    exit when rollcount (die) >= maxx
end loop