Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
[source] viewing a starry night
Author Message

Posted: Thu Jan 08, 2004 8:40 pm   Post subject: [source] viewing a starry night

I saw "Rowah" or someone make it, so I decided to post mine.
 code: %Starry Night Thing var counter, temp : int := 1 var x, y : array 1 .. 200 of int for i : 1 .. 200     x (i) := 0     y (i) := 0 end for for i : 1 .. 200     randint (x (i), -400, 1000)     randint (y (i), -400, 1000) end for loop     setscreen ("offscreenonly")     View.Update     Draw.FillBox (0, 0, maxx, maxy, 255)     delay (200)     for i : 1 .. 200         Draw.FillStar (x (i) - 10, y (i) - 10, x (i) + 10, y (i) + 10, 14)     end for     if counter = 20 then         randint (temp, 1, 8)         counter := 0     end if     for i : 1 .. 199         if temp = 1 then             x (i) := x (i) - 6         elsif temp = 2 then             x (i) := x (i) + 6         elsif temp = 3 then             y (i) := y (i) - 6         elsif temp = 4 then             y (i) := y (i) + 6         elsif temp = 5 then             x (i) := x (i) - 6             y (i) := y (i) - 6         elsif temp = 6 then             x (i) := x (i) + 6             y (i) := y (i) - 6         elsif temp = 7 then             x (i) := x (i) - 6             y (i) := y (i) + 6         elsif temp = 8 then             x (i) := x (i) + 6             y (i) := y (i) + 6         end if     end for     counter := counter + 1 end loop

Maverick

Posted: Thu Jan 08, 2004 9:20 pm   Post subject: (No subject)

good, yet laggy.

Posted: Thu Jan 08, 2004 9:44 pm   Post subject: (No subject)

Its supposed to be laggy...have you ever looked out at the stars? If so, do you spin your head around wildly and quickly, or slowly gaze across the distances, enjoying the scenery and the moment? Thats why there is "lag". (which is actually a delay )
Maverick

Posted: Thu Jan 08, 2004 9:48 pm   Post subject: (No subject)

I'm aware that its a delay.
To me that doesnt look like what you seem to be describing, but thats just me.
santabruzer

Posted: Sat Jan 10, 2004 4:32 pm   Post subject: (No subject)

i still say Asian's i think it was Snowflakes. or stars.. was amazing.. wonder if i can find it again ..
shorthair

Posted: Tue Jan 13, 2004 7:08 pm   Post subject: (No subject)

Its alright for a turing program , but the fake stars just ruin it , if you wrere to use dots and lines to make some constelations ( spelling) then i would be impressed , but its a good program to build on
Rowah

Posted: Thu Jan 15, 2004 11:52 am   Post subject: Heh

Hmm my starry night program was different.
Mines was about the stars you see at night, twinkling, appearing, dissappearing. You dont really see stars all yellow, and they ain't that big. My aim was a non-fictive approach, simple yet slick.
Good work but that isn't realistic and its ugly, im sorry but my thumbs are down on this one.

Posted: Thu Jan 15, 2004 2:02 pm   Post subject: (No subject)

*ouch* man...well, its not supposed to be that realastic anyways... plus, I did this like a couple months after I started programming, and for that time, it was pretty good. hmm..maybe ill have to design a "revenge of the starry night: stab fest" program to impress you ...but nah, too boring, heh.

santabruzer

Posted: Thu Jan 15, 2004 4:32 pm   Post subject: (No subject)

i dunnu.. i did a star program..
 code: % New type for "stars" or "snow"     type star :         record             x : int             y : int             clr : int         end record     const maxstar := 500     % Array for Stars     var stardot : array 1 .. maxstar of star     % Generating an Intial Value     for i : 1 .. maxstar         stardot (i).x := Rand.Int (0, maxx)         stardot (i).y := Rand.Int (0, maxy)         stardot (i).clr := Rand.Int (20, 31)     end for     % Regenerating the Intial Value     proc clearstar (number : int)         stardot (number).x := maxx         stardot (number).y := Rand.Int (0, maxy)         stardot (number).clr := Rand.Int (20, 31)     end clearstar     % General Execution Procedure             % Set the screen, and the back color         setscreen ("offscreenonly")         colorback (black)         cls         loop             for i : 1 .. maxstar                 % Draw the Star                 drawdot (stardot (i).x, stardot (i).y, stardot (i).clr)                 % Move the Star one left                 stardot (i).x -= 1                 % If Star is offscreen, refresh                 if stardot (i).x < 0 then                     clearstar (i)                 end if             end for             % Refresh the screen             View.Update             delay (10)             cls         end loop
shorthair

Posted: Thu Jan 15, 2004 5:07 pm   Post subject: (No subject)

Thats a much better starry night program ,if you were to connect some constelations into that , or some bitmaps of planets then it wiould be just awsopme , but hte effect taht you give is just amazing
Rowah

Posted: Fri Jan 16, 2004 11:39 am   Post subject: Heh

That was l33t..
santabruzer

Posted: Sat Jan 17, 2004 11:30 pm   Post subject: (No subject)

and all thanks to the world of records.. .. maybe i should become the "record warrior" or someone like that....

Posted: Sun Jan 18, 2004 11:20 am   Post subject: (No subject)

santabruzer wrote:
and all thanks to the world of records.. .. maybe i should become the "record warrior" or someone like that....

wait till you learn about objects (classes)
AsianSensation

Posted: Sun Jan 18, 2004 4:23 pm   Post subject: (No subject)

lol, yeah, structures (or records, as they call it in turing) is like halfway between normal programming and OOP. As PaddyLong said, learn Classes, they will help you so much later on.
santabruzer

Posted: Sun Jan 18, 2004 6:39 pm   Post subject: (No subject)

hmmm classes.. i like the sound of it.. i still wish though that turing had a function like TObject....
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 2  [ 19 Posts ]
Goto page 1, 2  Next
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: