Coders Strike Back - Puzzle Discussion


#294

Hmm… am I seeing some odd behaviour of the codingame runtime?

I’ve created a class to represent a pod - initialise it with the targetID… but when I then retrieve that value, it’s changed?

class Pod
{

int _targetID;

public Pod( int id, int x, int y, int vx, int vy, int angle, int targetID )
{
    ...
    _targetID = targetID;       
    Console.Error.WriteLine("Pod " + _id + " setup Target=" + _targetID );
}

public int TargetID
{
    get
    {
        return _targetID;
    }
}

public string Act( ... )
{
    Console.Error.WriteLine("Pod " + _id + " recover target=" + _targetID);
    ...

I initialise the object with ‘2’… but when I come to invoke Act(), it’s revised to ‘1’? There’s no other code that interacts with _targetID anywhere…

P


#295

Ah, figured it out. I’m a muppet…


#296

what is the thrust value for boost? just want to use it to make calculations, too lazy to simulate…