Feel free to send your feedback or ask some help here!
Anyway to get the last code I had in my editor from the contest, and not last submitted code?
Thanks!
Nope, only the one in the Arena. Sorry
Can you explain me why this battle is counted âwonâ for the Boss?
Just before the end, his last factory was being swamped with attacking troops, by far more than he produces in his last factory. So why is the final score of total troops 0:2?
Looks like you crashed. If I had to guess Iâd say your code is iterating a list of opponent factories and went thud when there werenât any.
Good point. I should have checked the console output at the end.
I was going to say just that lol
Hello world !
I donât understand how arg 1,2,3,4,5 are working here !
//if it's mine
if(arg1 == 1){
print("move 1 3 1");
}
//if Factory 3 is mine
if(entityId == 3 && arg1 == 1){
print("move 3 4 1");
}
print("wait");
for example this code is doing nothing but âwaitâ, how can I select a Factory to use itâs args ?
Have fun everybody !
If factory 1 and 3 belong to you, you will write 3 separate lines, thus giving output for 3 rounds.
An easy way is to store the complete input and then loop over all factories, checking if they are yours. If they are, find a factory that isnât and capture it.
You may want to watch the livestream, where two people for CodinGame tackle the problem.
I keep my old code in Git via IntelliJ and the synchronizing plugins in Chrome.
I have a problem in the code, I donât understand why my code print the wrong message,
in python I wrote :
message = "MOVE " + ⌠(I put my value here)
print >> sys.stderr, message
print message
And in the debug console I got :
Standard Error Stream:
MOVE 1 4 1
Standard Output Stream:
9MOVE 1 4 1
So I get an error âŚ
Do you guys have any ideas ?
I noticed some weird behavior with my bot, or more correctly a lack of behavior when sort of middle/late-game, despite there being considerably weak enemy factories left, my factories donât react or do anything despite when my logic should be telling them to do something, I double-checked all my logic and it seems correct.
My main logic in the while loop is pasted here
Method Link.GetTargetFactory
is defined here
An example of this can be seen in this screenshot â> imgur.com/a/YOhjnc3.
Difficult to help you here. Iâd advise replaying this same match and adding a lot of debug messages to understand why you donât take any action to send troops to weak enemy factories.
I think that âGhost In The Cellâ UI is bugged. It seems that bombs and troops are moving twice slower than expected. Battles are very hard to understand: factory production stops before the bomb hits the factory for example.
Is it possible to correct this bug please?
Thanks
youâre right. It has been reported to us yesterday and weâre working on a fix. Sorry about that. Iâll keep you updated!
Merci beaucoup!
I face a strange problem, whenever I build a string, it doesnât print in console at all.
I checked and double checked scope details, but anyway, when I print the final string in the error console, it prints nice, but after empty iterations.
Of course I checked that it wasnât in a for or while loop, but itâs just in the main game loop.
Simple example :
for (let j = 0, m = factory.length; j < m; j++) { if (factory[j].owner == 1) { instructions+= "MOVE "+factory[j].id+" 0 2;"; // hardcoded destination just to test } } printErr("INSTRUCTIONS:"+instructions); console.log(instructions);
there is the error console result :
Sortie dâerreur :
INSTRUCTIONS:
INSTRUCTIONS:
same again 21 times then the right string 3 times.
INSTRUCTIONS:MOVE 1 0 2;
INSTRUCTIONS:MOVE 1 0 2;
INSTRUCTIONS:MOVE 1 0 2;Sortie standard :
(nothing in the output)
Informations :
invalid input. Expected âA valid actionâ but found ââ
When I first try to loop over the link map, there are only pairs related to factory 0, so my starting factory is just one line (hope Iâm clear, I mean I canât get pairs starting from my factory.
I donât say there are any bugs, maybe I just got something wrong or missed an important point.
The best to do in these cases is to print debut messages to check that you correctly read each input.
Here, your factory array is empty. The root error lies in your first readline