[FAQ] (Really) Frequently Asked Questions

Nope.
Easiest two have merged; longest/hardest got migrated to community-contributed puzzles.

1 Like

I do measure the time of while() loop and at the beginning and at the end and debug-print it.

When I take a look at submitted game where I lost because didn’t provide output on time I see that the clock at the very end of while loop is 46ms.

And in case I send the game parameters to IDE it mostly works in there.

Considering that I don’t have any object that has to be destructed at the end of the while() loop, can someone please explain me why this is happening?

My code is in C++.

Thanks in advance

As CG web server receives your src, this is moment A. Your src is passed to a VM to compile to .o and then built into executable and then loaded to memory to execute. This is moment B. Your command to start your timer is discovered and executed. This is moment C.
CG’s timer may start at any time between A and B, which is earlier than C.
The two timers do not end at the same moment too.Details skipped. This could explain your experience.

The above are unofficial, system architectural speculations.

Thanks you for pointing it. I edited the FAQ.

Is it possible to ask for a hint based on my theory for a certain puzzle?
To be specific, I have figured out a way to solve challenge X. But most of the testcase fail. Now I really hit a block-writing one. Therefore, I would like everyone to point out where were my theory go wrong.

Is it considered as cheating? (I want to use my profile as a cv for jobs hunting, so I want to do it in the most fair and honest way.)

Getting a source to copy and paste to finish a puzzle is dishonest. Doing your brain-work to try finding out an approach or solution, and discuss it with others for improvement is a fair way of research and study.

Good questions attract good responses. Be specific, precise and concise. Posting hundreds lines of full source code is often not precise enough.

Most puzzles have their own thread of discussion. Keep your discussion to the belonging threads. Also review existing posts before asking to avoid too much duplication.

Happy coding.

5 Likes

Is there a way to see all feedbacks/comments, if there are any, on my published solutions? (instead of looking it up one-by-one for every puzzle I solved)

unfortunately, there is no way to do that. You should receive a in-site notification when someone comments on your solutions though.

  1. What strategy should I use to search for previous puzzles (especially CoC’s) when I see a contribution that looks like it might be a duplicate of an older one?
  2. When someone posts a link to a CoC end result, I see the rankings and scores and stuff, but it seems to be missing some things. I don’t even know what puzzle it is. Is this intentional design?
  3. What’s the point of following a user?
  4. And related - how do I see a user’s contributions?
  1. The best tool for that is the one created by @eulerscheZahl : http://eulerschezahl.herokuapp.com/codingame/puzzles/
  2. Yes. That feature was not a must-have at the time we created CoC.
  3. Among other things, you can follow their progression on puzzles and games you play.
  4. For now, unfortunately, you can’t from their profile. Using the tool I linked above, you can: CG Puzzle search

Hi. I’ve been getting a little frustrated with these puzzles - and probably even more so because I’m not sure I know how to explain what I’m frustrated about. Sigh.

I understand the basic building blocks of code (using JavaScript on puzzles) - loops, if/for/while statements, concatenation, logic, basic mathematical operations, etc. But I can’t really seem to understand the directions for most of these (even reading the hints, most of the time) even though I’ve had about a year’s worth of instruction in coding - and I’m a native English speaker.

I see a lot of details pertaining to the puzzle (e.g. Mars Landing - puzzle 1) but I don’t really see directions anywhere saying what you want me to actually do. This is where I get lost because I have all the information but I have no idea what to do with that information.

I see terms like stdout and the like and even with googling, I still have no idea what you want me to do with them. I often don’t even understand if certain necessary inputs are being automatically provided or if I need to come up with them. I wish directions were actually clear and easy to understand.

Because of all of this, these puzzles don’t feel like they’re for beginngers. I just end up frsutrated or overwhelmed and deflated, not wanting to practice coding at all :confused:

Which is a shame because the puzzles seem cool (the very first one I did when I was introduced to the platform) but I just don’t feel like it’s helpful to beginners if I can’t even understand what you are asking me to do.

If anyone can help clarify any of this or point to something I’m missing, I’d really appreciate it.

Otherwise, I think this platform, like most others out there, really isn’t interested in helping someone gain confidence in coding. Just helping those who are already have a solid base, sharpen their skills.

I’m not sure what the point is of another platform like that.

Hi martixana, it’s normal to be a bit frustrated at the beginning and it’s very good that you’re sharing that and seeking advise.

So, the main idea for platforms like CodinGame is to solve programming puzzles, tasks that will exercise your logical/algorithmic thinking and your programming skills in your language of choice. These tasks are so called input-output, which means that after you write your program it’s ran on a machine(server) which gives it specific input usually in the form of a text file. These tasks won’t tell you to implement an online store for example, but they’ll help you sharpen your general programming skills which could be adopted in any software development area afterwards. Image it as if you’re solving the problems from your math books back in school.

So, when you’re reading data from the standard input(using “readline()” in JavaScript) you are actually reading the data from that text file. After you have stored the input data, you have to use it to solve the given task and then output the result on the standard output(using “console.log(res)” in JavaScript)

For example let’s say that you’re given a task to read 2 numbers, add them and output their sum.
Each Test Case for the task is a text file with 2 numbers on separate lines, one of them could be:
01_Test_Case.txt:
4
8

When you run your program it’s given that txt file, you could imagine it like your program is like a function with an argument the txt file:
martixanaAddingProgram(“01_Test_Case.txt”)

Inside your program you must gather and store the contents(which is done by default for every puzzle) in this case you’re given 2 numbers on separate lines:
var n0 = parseInt(readline());
var n1 = parseInt(readline());

Now that you have the input data for the problem you must use it. In this case you must add the given numbers, so you could create a third variable called res, which will store the result
var res = n0 + n1;

After that you have the answer you have to output it, in the case of JavaScript, using console.log:
console.log(res)

After that the machine on which your program is run will get your output result and check if its correct(it has the correct answers for each test txt file) and report back to you.

I think the Mars Lander puzzle is a bit difficult to start out with(because it has many inputs).
I made for you a couple of almost trivial puzzles to solve so you could exercise what I talked above:

Add 3 numbers
You have to read 3 numbers and output their sum:

Output stars
You have to read a number and output that many “*” symbols on one line. You could use a loop or the repeat function for strings.

(I hope that the links are working)

Other than that I could suggest this tutorial which has similar “trivial” input-output tasks, but it’s payed.
Also you could think of different task by yourself, print your name in reverse, calculate a person’s age by given the date of birth,…
After you mastered the “trivial” tasks you could try solving The Descent puzzle on CodinGame

This dude has a very good introduction video about competitive programming as a whole.

I hope that I’ve helped you to clarify the things a bit more, ask if there is something else.
Have fun :slight_smile:

2 Likes

C# 10 will be released in a Week. CodinGame still uses 7.2 I think. Can we please update?

Thank you so much @Di_Masta I really appreciate you taking the time to write all of this. It means a lot. I will go work on thhose practice puzzles. :slight_smile:

1 Like

The link to the practice puzzles you sent don’t work but I’ll try and search for them. Starting on the youtube video, now.

1 Like

Hm, maybe because they are private, try this way:

Go to EDIT and then TEST IN IDE

How do I approve a contribution?

You approve it by clicking the APPROVE button. Please also note that the requirements for becoming an approver:

  • Any player who has played more than 50 clashes has approver rights of clash of code contributions.
  • Any player whose level is greater or equals to 20 has approver rights of contributions of other puzzle types.

But where is the approve button?

Depending on your window size, it may be somewhere near the bottom or somewhere on the right.