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

Username:   Password: 
 RegisterRegister   
 My rain program
Index -> Programming, Turing -> Turing Submissions
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
belarussian




PostPosted: Thu Dec 10, 2009 9:14 pm   Post subject: RE:My rain program

your not really doing any rain that is different than mine you are just changing the y value and making it faster. so yeah have a good day
Sponsor
Sponsor
Sponsor
sponsor
Euphoracle




PostPosted: Thu Dec 10, 2009 9:19 pm   Post subject: RE:My rain program

...You're aware this thread was started in 2005, right?
Srlancelot39




PostPosted: Fri Jan 08, 2010 2:15 pm   Post subject: Re: RE:My rain program

mirhagk @ Tue Dec 08, 2009 10:08 pm wrote:
you want rain, ill give you rain

Turing:

type RAIN :
    record
        x, y : real
        xv, yv : real
    end record
var rain : array 1 .. 500 of RAIN
setscreen("offscreenonly")
function createrain : RAIN
    var temp : RAIN
    temp.x := Rand.Int (0, maxx)
    temp.y := maxy
    temp.xv := (Rand.Real * 2 - 0.5) / 4
    temp.yv := (Rand.Real * 2)+1
    result temp
end createrain

fcn rainfall (r : RAIN) : RAIN
    var temp := r
    temp.x += temp.xv
    temp.y -= temp.yv
    if temp.y < 0 then
        temp := createrain
    end if
    result temp
end rainfall

proc drawrain (r : RAIN)
    Draw.ThickLine (round (r.x), round (r.y), round (r.x + r.xv), round (r.y + r.yv), 2, brightblue)
end drawrain

for i : 1 .. upper (rain)
    rain (i) := createrain
end for

loop
    for i : 1 .. upper (rain)
        rain (i) := rainfall (rain (i))
    end for
    cls
    for i : 1 .. upper (rain)
        drawrain (rain (i))
    end for
    View.Update
    Time.DelaySinceLast(5)
end loop


sweet....
I made some modifications too...I altered the code in the first function to make snow, light rain, heavy rain, and even a tornado effect lmao!
Srlancelot39




PostPosted: Fri Jan 08, 2010 2:22 pm   Post subject: Re: RE:My rain program

belarussian @ Tue Dec 08, 2009 8:23 pm wrote:
View.Set ("graphics:1024;768,nobuttonbar,nocursor,offscreenonly")

loop
Draw.Fill (100, 100, brightred, green)
const NoOfrain := 400
var rainX : array 1 .. NoOfrain of int
var rainY : array 1 .. NoOfrain of int

for rain : 1 .. NoOfrain
rainX (rain) := Rand.Int (0, maxx)
rainY (rain) := Rand.Int (0, maxy)
end for

for rain : 1 .. NoOfrain
%Drop The rain
rainY (rain) -= Rand.Int (1, 5)
%rainX (rain) += Rand.Int (-1, 1)
if rainY (rain) < 0 then
rainY (rain) := maxy
rainY (rain) := Rand.Int (0, maxx)
end if
Draw.FillOval (rainX (rain), rainY (rain), 1, 1, blue)
end for
%Update the screen (because of offscreen only)

View.Update
delay (100)
end loop


lol...that looks more like particle physics than rain
Srlancelot39




PostPosted: Tue Sep 07, 2010 11:12 pm   Post subject: Re: RE:My rain program

belarussian @ Thu Dec 10, 2009 8:14 pm wrote:
your not really doing any rain that is different than mine you are just changing the y value and making it faster. so yeah have a good day

really? looks significantly different to me. besides, mirhagk is a good sport, you're not - "so yeah have a good day".....honestly? sounds like jealousy to me...
andrew.




PostPosted: Wed Sep 08, 2010 6:57 am   Post subject: Re: RE:My rain program

To quote Euphoracle:
Euphoracle @ Thu Dec 10, 2009 9:19 pm wrote:
...You're aware this thread was started in 2005, right?
Dan




PostPosted: Wed Sep 08, 2010 9:18 am   Post subject: RE:My rain program

Thread locked due to necroposting.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
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 2 of 2  [ 22 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: