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

Username:   Password: 
 RegisterRegister   
 Interesting effect
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Paul




PostPosted: Mon Dec 13, 2004 11:29 am   Post subject: Interesting effect

From my projectile motion code
code:

setscreen ("graphics: max;max")
const grav:= 9.8
var speed, angle, Vhor, Vvert: real
var x, y: real
for b: 0..90 by 10
for c: 0..500 by 5
speed:=c
angle:=b
Vhor:= speed * (cosd (angle))
Vvert:= speed*(sind(angle))
    for a : 1 .. 1000000
  x := a / 100 * Vhor
        y := (Vvert * (a / 100) - 0.5 * grav * (a / 100) ** 2)
       
        drawdot (round (x ), round (y), black)
        exit when y <= 0
end for

end for

end for


edit: later
code:


setscreen ("graphics: max;max")
const grav:= 9.8
var speed, angle, Vhor, Vvert: real
var x, y: real
for b: 0..90 by 10
for c: 0..500 by 5
speed:=c
angle:=b
Vhor:= speed * (cosd (angle))
Vvert:= speed*(sind(angle))
    for a : 1 .. 1000000
  x := a / 100 * Vhor
        y := (Vvert * (a / 100) - 0.5 * grav * (a / 100) ** 2)
       
        drawdot (round (x ), round (y), black)
        drawdot (round(maxx-x), round(y),black)
        exit when y <= 0
end for

end for

end for
Sponsor
Sponsor
Sponsor
sponsor
zomg




PostPosted: Mon Dec 13, 2004 11:38 am   Post subject: (No subject)

interesting effect indeed

looks kewl when the screen is full
nice job
cool dude




PostPosted: Mon Dec 13, 2004 5:59 pm   Post subject: (No subject)

pretty cool! even though i remember seeing something similar like that on this site before not accusing u of anything though. u should take out that delay, and make it fullscreen because it looks awsome that way.
Paul




PostPosted: Mon Dec 13, 2004 6:09 pm   Post subject: (No subject)

check it.
code:

setscreen ("graphics: max;max")
drawfill (10,10,black,black)
const grav:= 9.8
var col: int
var speed, angle, Vhor, Vvert: real
var x, y: real
for b: 0..90 by 10
randint (col, 100, 150)
for c: 0..500 by 5
speed:=c
angle:=b
Vhor:= speed * (cosd (angle))
Vvert:= speed*(sind(angle))
    for a : 1 .. 1000000
  x := a / 100 * Vhor
        y := (Vvert * (a / 100) - 0.5 * grav * (a / 100) ** 2)
       
        drawdot (round (x ), round (y), col)
        drawdot (round(maxx-x), round(y),col)
        exit when y <= 0
end for

end for

end for


Kelsey




PostPosted: Mon Dec 13, 2004 9:46 pm   Post subject: (No subject)

Very cool Smile
BPhelmet




PostPosted: Wed Dec 15, 2004 9:36 pm   Post subject: (No subject)

interesting indeed
nice
m&m




PostPosted: Thu Dec 16, 2004 11:38 am   Post subject: (No subject)

kinda slow but it looks kewl
Delos




PostPosted: Thu Dec 16, 2004 5:39 pm   Post subject: (No subject)

Slow?

Try this:

code:

setscreen ("graphics:max;max;offscreenonly")
colourback (7)
drawfill (10, 10, black, black)
const grav := 9.8
var col : int
var speed, angle, Vhor, Vvert : real
var x, y : real
for b : 0 .. 90 by 10
    randint (col, 100, 150)
    for c : 0 .. 500 by 5
        speed := c
        angle := b
        Vhor := speed * (cosd (angle))
        Vvert := speed * (sind (angle))
        for a : 1 .. 1000000
            x := a / 100 * Vhor
            y := (Vvert * (a / 100) - 0.5 * grav * (a / 100) ** 2)

            drawfilloval (round (x), round (y), 3, 3, col)
            drawfilloval (round (maxx - x), round (y), 3, 3, col)
            exit when y <= 0
        end for
        View.Update
        cls
    end for
end for


Wink
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Thu Dec 16, 2004 7:37 pm   Post subject: (No subject)

Whoa, slow down there speed demon. Surprised
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  [ 9 Posts ]
Jump to:   


Style:  
Search: