Computer Science Canada

[source] ???

Author:  Catalyst [ Mon May 26, 2003 5:09 pm ]
Post subject:  [source] ???

i was digging around my old files and found this
i have no idea what this is
ne ideas would be helpful (lava lamp?)
code:

View.Set ("graphics:640;640,nobuttonbar,offscreenonly")
proc ColorAdd (c1, c2, n : int)
    var clr : int
    var r1, g1, b1 : real
    var r2, g2, b2 : real
    var p, p0 : real
    RGB.GetColor (c1, r1, g1, b1)
    RGB.GetColor (c2, r2, g2, b2)
    const a := 50
    for i : 1 .. n
        p := (i / n) * 100
        p0 := 100 - p
        clr := RGB.AddColor ((((r1 * p) + (r2 * p0)) / 2) / a, (((g1 * p) + (g2 * p0)) / 2) / a, (((b1 * p) + (b2 * p0)) / 2) / a)
    end for
end ColorAdd
const shad := 255
drawfillbox (0, 0, maxx, maxy, 40)
ColorAdd (44, 40, shad div 2)
ColorAdd (40, 44, shad div 2)
type part :
    record
        x, y, xv, yv, life : real
    end record
const numP := 101
const maxLife := 200
var main : array 1 .. numP of part
for i : 1 .. numP
    main (i).x := maxx div 2
    main (i).y := maxy div 2
    main (i).xv := Rand.Int (8, 10) * Rand.Int (-1, 1) * Rand.Real
    main (i).yv := Rand.Int (8, 10) * Rand.Int (-1, 1) * Rand.Real
    main (i).life := maxLife
end for
loop
    for i : 1 .. numP
        if main (i).life > 5 then
            main (i).x += sin (main (i).y) * main (i).xv
            main (i).y += cos   (main (i).x) * main (i).yv
            main (i).life -= 1
            drawfilloval (round (main (i).x), round (main (i).y), 50, 50, round ((main (i).life / maxLife) * shad) + 254)
        else
            main (i).life := maxLife
        end if
    end for
    View.Update
    % drawfillbox (0,0,maxx,maxy,1)
end loop

Author:  JSBN [ Mon May 26, 2003 5:29 pm ]
Post subject: 

AHHH it's trying to eat me!!!!! AHHHHHHHH

Author:  kythoon [ Mon May 26, 2003 5:48 pm ]
Post subject: 

thats ... thats ... ah different Rolling Eyes

Author:  TheDarkArcher [ Tue Nov 25, 2003 2:04 pm ]
Post subject:  its Ummmm.......

Well listening to Trance makes this thing ver cool
well... well... well... its makes as much sense as a carniverous cow
sorry i have no idea its interesting Rolling Eyes Rolling Eyes Rolling Eyes Shocked Rolling Eyes Rolling Eyes Rolling Eyes


: