Ghost in the Cell (aka Cyborg Uprising) - Puzzle Discussion

:robot: Feel free to send your feedback or ask some help here! :robot:

1 Like

Anyway to get the last code I had in my editor from the contest, and not last submitted code?

Thanks!

2 Likes

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.

1 Like

@eulerscheZahl thanks for your time, don’t want to give up on this one :slight_smile: i’ll check.
Have fun !

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

Yeah, you were definitely right, it is fixed now, thank you @TwoSteps !