This is my first day on Codingame, I started with the Training and passed the test cases for the first game, But When I wanted to submit my code,My final score was 0% and didnt pass any of the test. Can you explain How I should submit my code ?.
Hi, we can’t see your code so it’s hard to help you, anyway here is a general answer :
When you submit your code, it will pass another bench of random enemies. That way, you can’t just write the enemy name like Buzz, HotDroid (you have to find the best target in the for-loop then print it. One enemy per round) …
Moreover, your code have to pass all tests in a row.
Hope it’ll help you because these are common mistakes
Your solution should be generic, not using conditional statements like if(itLookLikesImDoingTest1()) {cout<<answer1;} else if...
So for every data possible, your solution should be correct. You need to select enemies to shoot dynamically by verifying in your code what enemy is the closest to your spacecraft.
That’s why. Not only you hardcoded the solution but you didn’t get the point.
Your program have to think by itself which battleship is the closest and shoot it.
In the end, you have to stock the name of that said ship into a string and do something like this: