private static int GetScore(LanderState state) { // prefer X between 4000 and 5500, HSpeed <= 40, VSpeed <= 20 var lDist = state.Position.X < 4000 ? 4000 - state.Position.X : 0; var rDist = state.Position.X > 5500 ? state.Position.X - 5500 : 0; var hsDist = state.Speed.HSpeed > 40 ? state.Speed.HSpeed - 40 : 0; var vsDist = state.Speed.VSpeed > 20 ? state.Speed.VSpeed - 20 : 0; return((int)Math.Round(lDist + rDist + hsDist + vsDist)); }
protected bool Equals(LanderState other) => Position == other.Position && Thrust == other.Thrust && Speed == other.Speed;