Cheating is forbidden, under penalty of disqualification from the CodinGame Contest. Cheating means:
Obfuscating your code as well as creating obstacles to its reading and understanding.
How can you add a rule like this wihout a proper announce ? And don’t tell me we are supposed to read all the contests rules at any contests. You know very well that near nobody read all the rules. This change was just announced on the chat once.
A few people in the top of the contests use a tool made by @Agade to be able to use the flag O3 for a C++ code. We asked for this flag on codingame for more than a year now. Codingame never did anything for it. @Agade took time to create this tool to made it available. The tool compile the code and convert it in a base85 string. So yes, it is obfuscated.
How can you decide to tag this tool as a cheat without at least telling @Agade ? What if a top 3 coder missed the message on the chat at the end of Wondev Woman ? You’ll just kick him/her ?
Now, the fun part : What is obfuscating ?
I make a horrible code with only one letter variables because i don’t know how to code. Allowed ?
I code with variables names in chinese. Allowed ? (i don’t think you can read chinese so it is an obstacle)
I use a minifier because my code reach the limit of 100k characters. Allowed ?
Even if it isn’t clear, they aren’t targetting machine learning, but bots scripted to make automatic submissions either for boost another account or try variation of magical numbers in code the whole day.
I might be wrong but, this could also be related to companies who support events like say, code for life.
They might actually sometimes want to have a look at the code of the best performers.
Obfuscating the code actually completely defeat the purpose for them.
On the other hand, I reckon that on my end, I write very “unprofessional” code for challenges in there.
For I’m just after performance and efficiency, I would never write code like that in a professional context.
Therefore, companies looking at this kind of code may get a pretty wrong picture with it…
But anyway, I can’t even tell for sure if they are interested in looking at the code in the first place…
I have the same question as Icebox’s. I’ve encoded and compressed arrays (or lists of arrays) especially for neural networks that I have pre-trained. Like Icebox’s code, I think it is reasonably clear what I am doing when you look at the code. (Also, of course, increasing the code file size would eliminate some of the need for these tricks.)
@Magus - just for curiosity - using @Agade code is better then
'#pragma GCC optimize “O3,omit-frame-pointer,inline” ’
'#pragma GCC optimize “Ofast,omit-frame-pointer,inline,unroll-loops” ’
Code is faster?
_CG_SaiksyApo had concerns about compressing executable parts. You don’t need to worry about compressing data unless, of course, your data is used to generate code later on.
Let’s say you write Python code on-the-fly and execute it (I don’t know why you would do that but let’s assume you’re doing it). Usually you would store the Python source code in a string, write it down to a file, and execute it. In that case, if the Python source code is compressed, it is unreadable and you may use it to execute hidden lines of code -> please don’t.
Apart from this crazy example, I’m pretty sure compressing data is totally legit here at Codingame.
Well, I must confess that I was looking into that tool to be able to compile rust code in release mode instead of in debug mode as (I assume) codingame does. The performance difference is abysmal.
I mean, it’s just a command-line argument that can actually make rust much more competitive, with performance allegedly comparable to C/C++. And debug mode is not how you are supposed to compile programs when performance matters.
As the resident Perl maniac… somehow (guess we’ll just have to wait until we get a better Perl maniac. Maybe it is because you don’t have a poorly coloured bike shed–the mascot of the Perl language)…
I’m well aware of the concept of obfuscating code… and there is a difference between messy code… and pieces of beautiful artwork that serve to marvel as much as they serve to make one vomit.
One is more inclined to merely stride through the gates of mordor than they are to accidentally make obfuscated code.
It has been stated there is a difference between poorly organised/designed code… and obfuscated code.
If anybody wants… I can try to track down some resources on proper code obfuscating–mostly making use of Perl… but only if you ask. As well–a lot of it is really really beautiful vomit inducing. Like… the things I’ve seen done. The beautiful beautiful terrible things I’ve seen done.