[FAQ] (Really) Frequently Asked Questions

Greetings everyone!

I’ve decided to create this topic to answer the most common questions that people ask and pin it so that everybody reads it before anything else.

Please consider doing it before posting.

Q: How do i play games?
This website is all about programming. You need to understand very little of it to proceed tough. Consider learning the following the basic to succeed the first game:

  • Variables
  • Conditionnal Statement: IF, ELSE IF, ELSE
  • Loop: WHILE, FOR
  • Input/Output: read, print etc

Q: What do I have to print on a game with a GUI?
When doing this kind of game, you have to print ONE action at every turn of the main loop. You cannot print all your solution at once (for a path finding algorithm for example).
If you have a solution like this:

if (X == 5)
    printf("SHOOT\n");
printf("STANDBY\n")

You’ll get into trouble, because if X is indeed equal to 5, then you’ll have printed both “SHOOT” and “STANDBY” for one game turn, which will cause the second instruction to be executed on the second turn. (You probably don’t wan’t that).

Q: My code pass all the tests but when i submit, i don’t get 100%?
To avoid cheating by hardcoding, the tests you have to pass on submit are slightly different than the code tests. Sometimes there are even some tests that are exclusive to submit tests. If you dont’t get 100% that means either:

  • You have a minor error in your code (roundage, etc)
  • You haven’t considered all the cases
  • You hardcoded
  • Codingame has a bug (really check your code before ;))

Q: I got 100% on a puzzle but it keep saying that i don’t complete it in the “Games” page
Most of the time, it’s because you have to wait about 5 minutes or even 1-2 hours for the site to update your status..

Q: Can we know how many people earn a specific achievement?
We can’t see for now how many people have earn an achievement, nor the percentage, but it IS planned in the roadmap of the staff.

UPDATE(29-01-2015): ‘Leaderboard’ section makes it easy to see your ranking and other people achievements.

Q: Why did you delete my code? Why can’t I post my code?
Posting code allow other users to paste it without thinking about the problem. Even is you intention are pure, I can assure you will have a really hard time thinking another solution by yourself once you saw someone’s code.
It is planned to add a topic for each puzzle that you can only access when you’ll score 100% so people can talk about it

You can post code when it’s a line or two and it’s helping other people understand what is your problem or to help someone understand. But copy-pasting your whole code will lead to deletion of the code or deletion of the post.

Q: What is clash of code?
Clash of Code (or CoC to be short) is a way to battle up to 7 other people at the same time in a limited time. There are three types of problems, Fastest, Shortest and Reverse.

  • Fastest are the more common, the first one to finish all the validators tests is ranked 1st, and so on.
  • Shortest is code golfing, you need to submit the shortest code possible that solve all tests, with each character counting.
  • Reverse is an odd one, you need to figure out what to do with the results displayed and no other clue (still need to be the fastest).

If you have any common question that I haven't put here, feel free to let me know in the comment.

You can have more info on the website FAQ: https://www.codingame.com/faq

EDIT (01/12/2015): Removal of an old question for Sponsor Challenges, add questions suggested by @yem_yem and @DollarAkshay

EDIT (23/11/2020) by @Magus : Removal of Clash of code difficulties.

21 Likes

Is there a way to see how many users solved each challenge?

4 Likes

Currently, there is not.

I’ve heard from many admin staff that was on the roadmap and so was going to happens sooner or latter, but I don’t know when.

1 Like

Regarding the how do i play games section i’d suggest some explanations to the selected programming language.

I tried to start the tutorial with Perl neither programmed with it before, nor played a game on this site before. If i hadn’t had knowledge about string concatination and the difference between a ’ ’ string and a " " string i’d never been able to progress the tutorial. This is awefull.

1 Like

The onboarding game is the simplest puzzle here, it takes approximatively 4-10 lines depending on the language used.

I myself have solved this problem with multiples languages, some I didn’t even know of. For the basics, a google search on “how to do a condition (if then else) in XXXXX”, “how to do a loop (while) in XXXXX” is more than enough to solve this puzzle in any language.

So while I understand that you may have had trouble, like every other sites, you need to search a little bit by yourself on the internet. Try to compare the difficulty curve here with the one on codewars for example, and you’ll impressed by how easy the first puzzles here are.

Hope that helped, and as the staff like to say: “Keep coding!” :wink:

7 Likes

Other really FAQ i gess. How do i get input for my script?
i mean there are spaceships with name, how i retrieve those names as stdin?

When you select a programming language, a sample code is made t help you get input for your script.

Basically, you need to read from the standard input.
Example in C++:

string enemy1;
cin >> enemy1; cin.ignore();

If you don’t know how to read from standard input, you may consider learning it before attempting the puzzle here.

Nevertheless, it is quiite easy to grasp, so don’t worry too much, you won’t have to learn many things to make progress.


By the way i already said it in “How do I play games?” the first question of this FAQ

how do I run output to the debug log? also, why does the script I start with change when I reset the script?

You might have been with an old version of the default script, it has been updated since. It’s clearly mentioned in it how to output debug information, in most language, that imply writing on the error output (stderr)

This message was previously posted on MIME puzzle:

I have made my solution in C++, it passes all the test cases successfully, but when I submited my solution, I got 90% with Consideration of the case (upper or lower) (100 pts) not being validated.

How could I know where I misdid in my solution ? it’s weird that the test cases don’t coverage all the test conditions but the validation test do.

Could you please enlighten me about this issue, thanks

2 Likes

Q: My code pass all the tests but when i submit, i don’t get 100%?
To avoid cheating by hardcoding, the tests you have to pass on submit are slightly different than the code tests. Sometimes there are even some tests that are exclusive to submit tests. If you dont’t get 100% that means either:

You have a minor error in your code (roundage, etc)
You haven’t considered all the cases
You hardcoded
Codingame has a bug (really check your code before ;))

Check all aff this, + if it’s upper lower case then try to see if your code can find the extension of .FFF .fFf .ffF, etc

Thanks for responding me, I understand what you mean and I agree with you 100%.
But here is my case:

I read the filename
I extract the extension --> FFF fFf ffF
I transform the extension in lowerCase --> strLower AND : fff fff fff
I transform the extension in UpperCase --> strUpper FFF FFF FFF

Then I check in my “map(extension, MIME)” for both strings AND the original extension
(fff fff fff) (FFF FFF FFF) ( FFF fFf ffF)


I don’t see how there could be a problem with this algorithm

I’m new to coding; I work in the IT sector, alongside people who have to code but have never had to myself. I thought I’d learn how to because it could only help, I started with C because I heard it’s good for beginners. I followed the tutorial and it was like it stopped halfway before explaining anything about the coding. I had no idea what I was supposed to do.

Q: How many processors is there available on the host machine to run my solution?

A: sysconf reports number of processors online = 4 (sometimes 8)

PS: if somebody wants to introduce solution which does not fit in the time mentioned in task description - you are welcome! for example if somebody can not extend his AI possibilities further due to time limitation - come on!

Actually, this site isn’t much about learning how to code, but practicing. Nevertheless, you can find a lot of people willing to help you get started in the Onboarding puzzle discussion and also in the irc chat that you can access on the left.

Feel free to read the numerous topic on this forum too, there are already people that recommend some website to learn the basics.

I think you should include this link on this topic or somewhere on the home page.

I couldnt find this anywhere. Had to search it via Google

2 Likes

“What is clash of code?” should be added somewhere in this.
Seems to be a usual question in IRC.

Maybe put a banner when joining which people can make disappear with a “don’t show me again”.

You don’t want people running away because they got a reverse clash as their first clash.

3 Likes

What does the “Unlocking Hint” feature in the new IDE is? Does ‘unlocking a hint’ have any consequences, like, points penalty, or is it merely here to… um… prevent the temptation to peek the answer?

@defazerz I dunno, I think it won’t give you less point, since Codingame point system have always been fair, but for more information, i’ll summon @G_Rom and/or @yohannjardin

There are no penalty for unlocking a hint.
It’s just that some people do not want to get a hint, we do not want to force them to get the hint. That’s all :slight_smile:

1 Like