Pyramid
Author |
Message |
TheFerret
![](http://compsci.ca/v3/uploads/user_avatars/1203353290461453ed4f045.jpg)
|
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
|
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Paul
![](http://i12.photobucket.com/albums/a207/paulbian/DDRDuck.png)
|
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
|
? |
|
|
|
|
![](images/spacer.gif) |
TheFerret
![](http://compsci.ca/v3/uploads/user_avatars/1203353290461453ed4f045.jpg)
|
Posted: Tue Mar 09, 2004 7:34 pm Post subject: (No subject) |
|
|
It is a mistake, I am updating the main one... |
|
|
|
|
![](images/spacer.gif) |
TheFerret
![](http://compsci.ca/v3/uploads/user_avatars/1203353290461453ed4f045.jpg)
|
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
|
|
|
|
|
|
![](images/spacer.gif) |
jonos
![](http://jonos.f2g.net/pictures/rankca.gif)
|
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. |
|
|
|
|
![](images/spacer.gif) |
TheFerret
![](http://compsci.ca/v3/uploads/user_avatars/1203353290461453ed4f045.jpg)
|
Posted: Wed Mar 10, 2004 9:59 am Post subject: (No subject) |
|
|
I made an updated version...
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
|
|
|
|
|
|
![](images/spacer.gif) |
magicman
![](http://clanff7.cl.funpic.org/modules/Forums/images/avatars/5066862484383ad4eaf5d5.jpg)
|
Posted: Wed Mar 10, 2004 10:27 am Post subject: (No subject) |
|
|
That's pretty good man..
nice job
r u a newby? ![Shocked Shocked](images/smiles/icon_eek.gif) |
|
|
|
|
![](images/spacer.gif) |
jonos
![](http://jonos.f2g.net/pictures/rankca.gif)
|
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. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
TheFerret
![](http://compsci.ca/v3/uploads/user_avatars/1203353290461453ed4f045.jpg)
|
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... |
|
|
|
|
![](images/spacer.gif) |
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 |
|
|
|
|
![](images/spacer.gif) |
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 |
|
|
|
|
![](images/spacer.gif) |
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... |
|
|
|
|
![](images/spacer.gif) |
apomb
![](http://compsci.ca/v3/uploads/user_avatars/6489609347028a0f2422f.png)
|
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! |
|
|
|
|
![](images/spacer.gif) |
|
|