# Code VS Zombies - Optimization - Puzzle discussion

You just to move these variables outside the while loop.

I think he meant between two different levels. Each time you run your code, variables are deleted.

I’ve scored 64180, but I’m not getting a ranking. Did I do something wrong?

we probably have a bug here. We’re on it

Where can we find the source code of the game to develop Genetic Algorithms?

Could someone pls tell me if you are able to print the first target coordinates? It seems, that the first target coordinates are given and you cannot change. Is that correct?

Edit: my fault, everything is fine

You could improve that and finding better solutions between the next frame (with lower time) and begin the simulation with current game state. The algorithm might find still better solutions. If so, just update the path. You can repeat that in every frame.

It won’t compute a score for me. I am submitting with Python3.

We had an issue yesterday with the submits. It is solved now.

I have a problem with the YNext move of a zombie. In a map with one human and one zombie, the XNext of the zombie will be the X of the human but the YNext will be a weird integer changing each turn.

It does not seem normal to me but if it does, i would appreciate some explanation about this behavior.

Thanks

Is something wrong with the ranking? Some players have 0 score now.

We’re currently changing the machines used for optimization puzzles (+code golf puzzles). Hence, we’re rerunning all solutions.

1 Like

Any chance you can check the current status of the Code Golf and Optimization problems? None of them show the score or the leaderboards. It’s most likely an internal bug.

The start point of our " Ash" is very important, but I can’t find it.
Help~

Ash’s position is the first line of input given each turn.
So, his starting position is his turn1 position.

1 Like

Hey guys,

I got the my code to work (with the exception of one edge case… I’ll figure it out), which is a first for one of these kinds of puzzles. I’m pretty new to all of this stuff, and have yet to do any kind of optimization.

Where would be the best place to start to work on improving score? Currently my logic is super rudimentary: I find the nearest human that I can save, and I sit on top of him. Which is fun to watch everyone else get slaughtered whilst I wait and watch

I’m just looking to see where I can take it, one baby step at a time. I’m already super happy I managed to even make the thing run.

First of all, I find it helpful to think of the challenge not as a coding optimization problem, but as if it were a board game. This makes it easier to come up with strategies to get a higher score. Once you have a fleshed out strategy, try to implement it into your code, one idea at a time. Test each idea you have before moving on to new strategies.

The implementation is almost always the hard part. Of course you can come up with a strategy like “don’t let any humans die”, which would be hard to implement with no further knowledge. Instead, you can refine this strategy into smaller and smaller tasks which can be implemented more easily. For example, you can break this down into “which humans can’t be saved?” and then “only focus on saving humans that can be saved.” This breakdown will make it so you don’t unnecessarily target humans that have no chance anyway.

Once again, this breakdown becomes a challenge as well. The question “which humans can’t be saved?” is a lot to think about and would have to be broken down into smaller subtasks as well. If you continue this process for any strategy you might want to implement, you should end up with a strong AI.

2 Likes

How can I check if a zombie has died or not so that I can move towards the other zombies?

P.S. Has anyone noticed the weirdness of dates and repeated replies in the forums?

Zombies are given in the input at every turn. In case you already read it but don’t see any changes, maybe you don’t clear your list between turns.

What do you mean?

I think the text 1 months later / 2 months later is unnecessary info while date is already there, and the replies are shown twice, once under the replied post like a reply and again a little below like a new post.
Isn’t that weird?