Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Pyramid
Author Message
TheFerret

Posted: Tue Mar 09, 2004 6:51 pm   Post subject: Pyramid

This is a cool program that I have made, I made it at school during free time but forgot about it, I made this one at home and will put the other one up tommorow at school... The one at school is better...

UPDATED

 code: /* Travis Baker March 9, 2004 Pyramid */ setscreen ("graphics:400;400") var x, y, x1, y1, col, col1, num : int x := 0 y := 0 x1 := 400 y1 := 400 col := 1 col1 := 255 put "Enter number (Below 255)" get num cls loop     for i : 1 .. 400         delay (1)         x += 1         y += 1         x1 -= 1         y1 -= 1         col += 2         if col >= 255 then             col := 1         end if         drawbox (x, y, x1, y1, col)         x += 1         y += 1         x1 -= 1         y1 -= 1         %col1-=num         col1 := num + 23         if col1 <= 1 or col1 >= 255 then             col1 := 255         end if         drawbox (x, y, x1, y1, col1)     end for end loop

Paul

Posted: Tue Mar 09, 2004 7:28 pm   Post subject: (No subject)

Hehe, it can be seen as a pyramid or tunnel what were you trying to do with
col1 and
 code: col1-=num if col1<=1 then col1:=num+23 end if

?
TheFerret

Posted: Tue Mar 09, 2004 7:34 pm   Post subject: (No subject)

It is a mistake, I am updating the main one...
TheFerret

Posted: Wed Mar 10, 2004 7:53 am   Post subject: (No subject)

This is the version that I made at school...

 code: var x,y,x1,y1,col,space:int x:=0 y:=0 x1:=400 y1:=400 col:=1 space:=1 put "Enter spacing (Below 256)" get space loop col:=1 for i:1..400 drawbox(x,y,x1,y1,col) x+=1 y+=1 x1-=1 y1-=1 col+=1 if col>=255  or col<=0 then col:=1 end if drawbox(x,y,x1,y1,col) x+=1 y+=1 x1-=1 y1-=1 col+=space if col>=255 or col<=0 then col:=1 end if end for end loop
jonos

Posted: Wed Mar 10, 2004 8:01 am   Post subject: (No subject)

thats some pretty neat stuff. if you make it into an animation you could use it to clear your screen if you are making a longer prog or game.
TheFerret

Posted: Wed Mar 10, 2004 9:59 am   Post subject: (No subject)

 code: col1 := 255 changex := 1 changex1 := 1 changey1 := 1 changey := 1 put "Enter number (Below 255)" get num cls loop     for i : 1 .. 400         delay (25)         x += changex         y += changex1         x1 += changex1         y1 += changey1         x += 1         y += 1         x1 -= 1         y1 -= 1         col += 2         if col >= 255 then             col := 1         end if         drawbox (x, y, x1, y1, col)         x += 1         y += 1         x1 -= 1         y1 -= 1         %col1-=num         col1 := num + 23         if col1 <= 1 or col1 >= 255 then             col1 := 255         end if         drawbox (x, y, x1, y1, col1)         if x >= maxx then             changex *=-1             elsif x1>=maxx then             changex1*=-1             elsif y>=maxy then             changey*=-1             elsif y1>=maxy then             changey1*=-1             elsif x<=0 then             changex*=-1             elsif x1<=0 then             changex*=-1             elsif y<=0 then             changey*=-1             elsif y1<=0 then             changey1*=-1             end if         end for     end loop
magicman

Posted: Wed Mar 10, 2004 10:27 am   Post subject: (No subject)

That's pretty good man..
nice job

r u a newby?
jonos

Posted: Wed Mar 10, 2004 11:55 am   Post subject: (No subject)

nice job... keep up the good work and nice animations. now you should try to make something a little more complicated with circles and other shapes. next time post the whole code so we don't have to add in the declaration of variables.

TheFerret

Posted: Wed Mar 10, 2004 4:23 pm   Post subject: (No subject)

I thought I copied it all but I guess I didn't, sorry...
the_short1

Posted: Wed Mar 10, 2004 5:26 pm   Post subject: (No subject)

ok.... but a delay of (10) is needed.... i guess the comp you made this with is Extremely slow...

also.... maybe post as a .t file... (attachment) so its ez to open up

other wise cool looking.. but i agree with jonos.... try to make something with more shapes and designs....... great start to turing programming..

Next thing... watch u make a pong game... :O
white_dragon

Posted: Wed Mar 10, 2004 5:44 pm   Post subject: (No subject)

lol! pong is da first newby games made. i made one 2
the_short1

Posted: Wed Mar 10, 2004 5:51 pm   Post subject: (No subject)

i skiped the nooby programs (except kevin da shorts cool visuals) and when straigh to pac man... (taht was in nov, started in sep)...

i think half the ppl taht finished compsci gr. 10 ( with an average grade) either made or tried to malke a pong game...
apomb

Posted: Wed Mar 10, 2004 8:07 pm   Post subject: (No subject)

Well, in gr 10 i made a 007 program ..wait it had the same bouncy ball thing like pong nvmnd but ne ways ... nice visuals .. a little simple, but good for a nooob, keep it up and we'll see some great things!
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 13 Posts ]
 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: