Skip to main content
GameDev.net gamedev.net
🔒 Locked

2nd place Again!

Started by Supaflyfrank Apr 4, 2005 at 9:46 PM 9 replies 1.5k views
Original Post
Supaflyfrank
Supaflyfrank
hey just wondering is there any tips or articles anyone have or can show me so I can finally get 1st place in my C++ competition in my club. First time I won 2nd place in the District Competition. Then today I found out i got 2nd competition in the Florida State competition. I get to go to nationals now which is all good but i am tired of 2nd place. Any tips or advice for furthering my goal?
antareus
antareus
The more angle brackets you have in your code, the better a programmer you are. So I suggest templating everything.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
bkt
bkt
I'm not sure what kind of competition it is (the rules, etc), but I would guess the more that you show your knowledge of C++ the better. Therefore, the use of proper OO-design (which I believe is a major step from being a programmer, and a good programmer) and templates (which I believe seperates good programmers, from great ones - something I have not mastered yet) is definately the best route. Of course, properly formatting your code is a plus, and make sure to use those comments everywhere!

What I have been doing in my class (because my introduction teacher to C++ is anal about comments) is forcing myself to use an XML commenting scheme, for example:
// <summary> this is a summary of the below function, it does x, y z </summary>// <param1> the first parameter is an integer, passed by reference </param1>// <param2> the second parameter is a string, passed by value </param2>// <return> this function returns nothing </return>void Function(int& someInt, std::string szString){   // comments here}

I find it easier for people to read (and she actually loved the idea of using these types of comments) especially when being told exactly what the comment is for. The comments are there for the ease of use, and modification of the code. But when people are juding your code, they want to be able to easily distinguish it from someone elses - this would probably help you.

Write it clean, make it efficient, you should be fine. Good luck!
-John "bKT" Bellone [homepage] [[email=j.bellone@flipsidesoftware.com]email[/email]]
_Madman_
_Madman_
Templates are handy and so, but AFAIK they are good to avoid in gaming and performance oriented apps. If I'm not wrong compiler makes template for every possible variable type in memory, not the thing you usually want if you have limited RAM.
______Madman
Cygon
Cygon
Don't want to lead this to a template-discussion, but you are wrong ;)

Templates cost you absolutely nothing performance-wise. Not a single clock cycle. Templates are nothing but normal classes/functions, just that you can specify some type/integer arguments which are evaluated by the compiler as it would be done with a #define.

Only for each type you actually instantiate a template with, a class will be generated by the compiler. I'm not saying that you cannot induce code-bloat with templates, trashing the CPU cache, but most often, you would have to write multiple variants of that class anyway and templates only help you reducing the maintenance work when doing so.

-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
AcidInjury
AcidInjury
Also, templates only generate the methods that you actually use.
achacha
achacha
Templates are a great tool, the big downside is that they are difficult to debug and often require several steps to evaluate them (like iterator or map); you have to copy addresses into memeory watch window to see what is going on.

They can also cause some debuggers (like SunC ones to crash) if you have lets say std::map > which may generate variable names >1k causing it to crash, last I heard Sun had a patch for this bug last year that raised the variable length limit to a higher number, but it is still rough demangling the name :)

Otherwise I love templates, they have saved me a lot of repetative coding time.


As for you competition, it is very hard to give advice without knowing the rules. Many of those competitions are very subjective, like an art competition, all in the eyes of the judge...who may or may not even be at your level of understanding the language.
++Alex
Supaflyfrank
Supaflyfrank
to be honest non of the questions are that difficult. Examples of questions they ask are:
int array [3][4]; How many bytes does this take up.
they love to use recursion functions like dog(dog(dog/2))) and they give you what ever code and ask you what is xxxx value if they dog function store a value or what does it display etc...not much classes. linked list binary tress. Different sorting alga...
This is basically what it says it will be testing on.
The written objective test for C++ programming will
consist of items related to arrays; computer concepts;
word functions including subprocedures or subroutines;
programming structures: sequence, decision/
selection and repetition; variables; constants; debugging
procedures; types of input and output; and
strings.

Any chance anyone know where i can find a dozen+ c++ test i can take. Problem the best way i can prepare. Some website or what ever that give multiple choice test.
Jingo
Jingo
Try googling for C++/C interview questions.
auLucifer
auLucifer
In the worldskills here in Au I won the regionals (in Qld) and came second in the nationals.
What I found out though was all I needed to improve was my initial design.
Don't use UML.
If you do, only use it a little bit.
Try for a top down design as well as a data dictionary. And make sure you label it as such.
I only lost by 7% and this is where that 7% was lost.

And during the actual production make sure that you actually follow the design. A lot of marks are usually awarded to that.
sjelkjd
sjelkjd
You might want to look at some Computer Science AP test questions online:

http://www.collegeboard.com/prod_downloads/ap/students/compsci/compsci_a_frq_02.pdf

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.