Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Some fancy looking dots.
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Neo




PostPosted: Tue Nov 16, 2004 5:24 pm   Post subject: Some fancy looking dots.

I was messing around and came up with this by accident.

code:
View.Set ("graphics:300;300,offscreenonly")
const numdots := 2000
var x, y, angle, d, spd : array 1 .. numdots of real
var c := 35

for i : 1 .. numdots
    x (i) := 0.0
    angle (i) := 0.0
    y (i) := 0.0
    angle (i) := 0.0
    d (i) := 0.1 * i
    spd (i) := 0.01 * i
end for

loop
    drawfillbox (0, 0, maxx, maxy, black)
    for i : 1 .. numdots
        x (i) := d (i) * (cos (angle (i))) + (maxx div 2)
        y (i) := d (i) * (sin (angle (i))) + (maxy div 2)
        angle (i) += spd (i)
        drawdot (round (x (i)), round (y (i)), c)
    end for

    if c >= 104 then
        c := 35
    end if
    c += 1

    delay (60)
    View.Update
end loop
Sponsor
Sponsor
Sponsor
sponsor
cool dude




PostPosted: Tue Nov 16, 2004 6:33 pm   Post subject: (No subject)

wow, thats nice. although i don't understand your code because i wasn't taught cos, and that other stuff yet. good job!
josh




PostPosted: Tue Nov 16, 2004 8:10 pm   Post subject: (No subject)

pretty nice for "just messing around" Very Happy
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: