Having run over 50 programming challenges, there are a few requests I'd make for anyone who enters. 95% of people already get these but it's the other 5% that don't and cause me to spend a bit too much of my time; that's usually when I have to post that marking isn't completed and take an extra day or two.
The easiest entries for me are those with accompanying Visual C++/C# projects, and it means you can optimize for code size, optimization level etc.
I'm Running Code on Windows
My underlying principle is that the same compilers running on the same hardware and are used to build the entries in release mode to make it a level playing field. In this case it's my Core i7, Windows 7 Pro (64 bit) PC with 6GB of ramI won't run any exes you send, but instead will always build the sources and run that. So no need to send any binary files.
I tend to compile code for 32 bit. If yours runs faster as 64 bit, tell me and I'll make sure it compiles that way, or better still include the project files with all your configurations preset. All I do is a clean and then build.
For C# entries that isn't a problem, just zip up the project folder and delete any large binary files such as obj, pdb and exe.
For C/C++. Again if you are running Visual C++, even an Express version, just zip up the folders and remove the large binaries before emailing. If you have compiled it with GCC/G++, please just send the source files (.c, .cpp, .h etc) and I'll create a Visual C++ project for it. Please don't use any GCC specific features or optimizations unless you really really have to.
For C that means declare all local variables at the start of functions. I've seen variables declared in the code several times and usually I have to move those variables, or sometimes I cheat and rename the source files to .cpp and change <stdio.h> to <cstdio> etc. I reckon if someone has gone to the trouble of writing a challenge entry then the least I can do is get it to compile. I'll even do a bit of debugging if needed to overcome problems.
For C++ add #include <string> if you use std::string. One of the entries in Challenge 53 had this issue (the person entering it said he had developed it on a Linux box) and it wouldn't compile under Visual C++, but all it took was adding that include.
C or C++
I've seen cpp source code that is pure C. No classes, references or anything C++ etc used. That's ok. So long as it compiles as a .cpp file then it's fine by me.
No C99/C11 Features
Please avoid using C99 or C11 features as Microsoft C++ does not handle these. If you must, see the notes on GCC/G++ below.
Timed Results and No Caching!
Some challenges have had code submitted that runs in microseconds or hundreds of nano seconds per cycle. If it's a speed challenge there's just too much uncertainty with timing one run so that's why I ask people to loop it and work out the average time (total time/number of loops).
One or two developers have been sneaky and thought, just do the computation on the first run and then output the cached results on subsequent runs. Caching of results is not allowed.
I'd never stated it before so hadn't enforced it but I will now. It distorts the computation time so caching of results is not allowed. Your code must do the full computation on each cycle. No partial caching either! E.g. pre-calculating say a table of sines and then using it in subsequent runs.
Some entries use my timing code within their source code, others just include it. Either way is fine.
This code below will do high speed timing for Windows (first three) and the fourth one for Linux.
No Fixed paths or Program Arguments
Challenges which have input or output files can always assume the files will be in the same location as the exe and should not need to have the path supplied. Please don't specify paths in parameters. I have allowed it in the past, but it's better and easier for me if you don't!
Multi-threading and Multi-Core Code is allowed
It's a valid coding technique, so splitting computational work between cores is permitted. In 53 challenges I've only seen it done once but it made a heck of a difference. Just so you know, my PC has 4 cores with hyperthreading so it appears as if it has eight. Your software though should not be hard coded to eight but check how many are in use and use that number.
GCC/G++
I have these installed and if your entry has to be built with GCC or G++, will use them. Please include the command line(s) to build/link with your desired optimization parameters and remember that I can build 64 bit or 32 bit so choose whichever is best. I don't know which compiler produces faster code. That's why my preference is to use Visual C++ but I'm not inflexible.
Conclusion
That's it. Nothing too heavy I hope!


