Computer Science Canada

GRASS PROGRAM

Author:  Triple Five [ Wed Dec 10, 2003 2:45 pm ]
Post subject:  GRASS PROGRAM

code:
randint(gy,mingy,maxgy)
dify:=maxgy-mingy
if gy<mingy+(dify div 3) then
drawfillbox(gx,gy,gx+1,gy+5,119)
drawbox(gx,gy,gx+2,gy+5,215)
end if
if gy<mingy+(dify div 3*2+5) and gy>mingy+(dify div 3-5) then
drawfillbox(gx,gy,gx+1,gy+4,120)
drawbox(gx,gy,gx+2,gy+4,215)
end if
if gy<mingy+(dify div 3) then
drawfillbox(gx,gy+(dify div 3*2),gx+1,gy+4+(dify div 3*2),122)
drawbox(gx,gy+(dify div 3*2),gx+2,gy+4+(dify div 3*2),215)
end if
end for
drawbox(mingx,mingy,maxgx+2,maxgy,175)
end grass

setscreen("graphics:640;580,nocursor")

grass(-2,maxx,60,200)

Author:  Tony [ Wed Dec 10, 2003 2:54 pm ]
Post subject: 

umm Confused I think you're missing a part of the code there... you didnt declear any variables or even started your forloops for that matter Laughing

Author:  Triple Five [ Wed Dec 10, 2003 7:41 pm ]
Post subject: 

you would be right...i missed the var statements when i copied a past my code from winOOT to the forum Laughing (im a n00b)

Author:  Triple Five [ Wed Dec 10, 2003 7:57 pm ]
Post subject: 

at this to the top of the code

code:
var gx,gy,dify:int

procedure grass(mingx,maxgx,mingy,maxgy:int)
 drawfillbox(mingx,mingy,maxgx+2,maxgy,117)
 drawbox(mingx,mingy,maxgx+2,maxgy,175)
for i:0..20000


and it should work Very Happy

Author:  poly [ Wed Dec 10, 2003 8:17 pm ]
Post subject: 

drawfillbox(gx,gy,gx+1,gy+4,120)
Variable has no value

hmmm dont work for me just gives me that.[/quote]

Author:  Maverick [ Thu Dec 11, 2003 3:02 pm ]
Post subject: 

Doesn't work. Maybe you copied it out of the booklet wrong. Laughing

Author:  DanShadow [ Sat Dec 13, 2003 6:46 pm ]
Post subject: 

umm...I got the same error, but was smart enough just to make the variables (gx:=100,gy:=100)...and its...well ok. Its a pretty neat effect, except for the fact that the width of your grass thing is like 3 pixels...lol

Author:  santabruzer [ Sat Dec 13, 2003 9:11 pm ]
Post subject: 

yea, same problem.. maybe it's the program.. Rolling Eyes

Author:  DanShadow [ Sat Dec 13, 2003 9:25 pm ]
Post subject: 

Yeah, its definitely the program...he made a neat grass effect, but its 3 pixels wide...and his variables are empty, heh

Author:  Thuged_Out_G [ Sun Dec 14, 2003 1:33 am ]
Post subject: 

i dont see how that resembles grass...looks like a green line moving over a green box Confused

Author:  DanShadow [ Tue Dec 16, 2003 11:55 am ]
Post subject: 

I think it looks like wind blowing through grass. (In some odd way). I also think that is what he was trying to protray in his program

Author:  shorthair [ Wed Jan 07, 2004 10:51 am ]
Post subject: 

I think that for a new programmer , its awsome , dont judge it from an experianced point of view , GOOD JOB man , keep up the good prograns , just make sure the code all works before you post it

Author:  Schaef [ Sun Jan 18, 2004 6:03 pm ]
Post subject: 

he didnt even put a value for his variables


: