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

Username:   Password: 
 RegisterRegister   
 GRASS PROGRAM
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Triple Five




PostPosted: 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)
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Dec 10, 2003 2:54 pm   Post subject: (No 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Triple Five




PostPosted: Wed Dec 10, 2003 7:41 pm   Post subject: (No 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)
Triple Five




PostPosted: Wed Dec 10, 2003 7:57 pm   Post subject: (No 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
poly




PostPosted: Wed Dec 10, 2003 8:17 pm   Post subject: (No subject)

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

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




PostPosted: Thu Dec 11, 2003 3:02 pm   Post subject: (No subject)

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




PostPosted: Sat Dec 13, 2003 6:46 pm   Post subject: (No 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
santabruzer




PostPosted: Sat Dec 13, 2003 9:11 pm   Post subject: (No subject)

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




PostPosted: Sat Dec 13, 2003 9:25 pm   Post subject: (No subject)

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




PostPosted: Sun Dec 14, 2003 1:33 am   Post subject: (No subject)

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




PostPosted: Tue Dec 16, 2003 11:55 am   Post subject: (No 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
shorthair




PostPosted: Wed Jan 07, 2004 10:51 am   Post subject: (No 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
Schaef




PostPosted: Sun Jan 18, 2004 6:03 pm   Post subject: (No subject)

he didnt even put a value for his variables
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 1 of 1  [ 13 Posts ]
Jump to:   


Style:  
Search: