We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Stewie Griffin
Pages: 1 2 
Stewie Griffin (Read 1878 times)
Re: Stewie Griffin
Reply #15 - May 8th, 2008, 3:38pm
 
tell me what you think of my drawing i am just a beginner just trying to get a good grade on a project i am open to any suggestions.
Re: Stewie Griffin
Reply #16 - May 8th, 2008, 9:50pm
 
Hey Beckman08 - A couple thoughts:

Your code ended up generating a decent likeness to the character, so that's good.  


However, I think you're missing the greater purpose of programming.   As a programmer, you are trying to find ways to save yourself work - not create more work.  You could have written a simple drawing program in much less code than it took to draw the character!

You also cost yourself a lot of time drawing a solid rectangle by filling in each individual line.  As a programmer, always look at the Reference information available to you.  You would have found the rect() function.  

For example in part 8, the code:
Code:

beginShape(LINES);

vertex(385, 256);

vertex(385, 120);

vertex(386, 256);

vertex(386, 120);

vertex(387, 256);

vertex(387, 120);

vertex(388, 256);

vertex(388, 120);

vertex(389, 256);

vertex(389, 120);

vertex(390, 256);

vertex(390, 120);

vertex(391, 256);

vertex(391, 120);

vertex(392, 256);

vertex(392, 120);

vertex(393, 256);

vertex(393, 120);

vertex(394, 256);

vertex(394, 120);

vertex(395, 256);

vertex(395, 120);

vertex(396, 256);

vertex(396, 120);

vertex(397, 256);

vertex(397, 120);

vertex(398, 256);

vertex(398, 120);

vertex(399, 256);

vertex(399, 120);

vertex(400, 256);

vertex(400, 120);

vertex(401, 256);

vertex(401, 120);

vertex(402, 256);

vertex(402, 120);

vertex(403, 256);

vertex(403, 120);

endShape();

could be replaced by a single call to rect():
Code:

rect(385,120,18,136);


My first suggestion would be to go through and use rect() wherever you can.

Some general notes:

Programmers hate to do things repeatedly.  We always find ways to do things more efficiently. There is almost always a better way!  

Programmers hate unnecessarily long code!  :-p Smaller is ALWAYS better.  :-D  

To learn programming you need to read a lot.  You read the reference docs, to see what functions are available to you (rect()!), read examples to see how to use different functions, and you read source code to see what others are doing or having trouble with.  Even the biggest guru coders read alot.  (Probably the most!)

Reading will help you solve issues, give you ideas, show you new ways to consider a problem.

So, I would reccomend you read the following:

http://processing.org/reference/rect_.html

http://processing.org/learning/basics/variables.html

http://processing.org/learning/basics/functions.html

http://processing.org/learning/basics/iteration.html


I admire your effort to code all that drawing by hand.  But if it were a beginning programming class, I would grade this a C.  Now, go back and optimize your program!  Good luck!
Re: Stewie Griffin
Reply #17 - May 9th, 2008, 11:48am
 
Psh you guys are haters Smiley I love the fact that he built everything bit by bit. What a beautiful exercise in futility, a true work of art. What's wrong with a bit of hand-coding now and then?

In all seriousness... I agreed with the above although I believe the joke's on us :p. Nonetheless, it's good to see Stewie on Processing!
Re: Stewie Griffin
Reply #18 - May 9th, 2008, 11:42pm
 
Pseudo-outsider meta trolling?!
Re: Stewie Griffin
Reply #19 - May 12th, 2008, 3:34pm
 
I did all the code by hand and had mini help but this is something i am proud of i have never programmed in my life and to make this i am happy
Pages: 1 2