Debugging an algo

So say I want my algo to react in a specific way in some scenario. In that case I cant simply use a replay where that scenario took place, because i cant visually see how my algo reacted and what it placed etc…
On the other hand, upload the algo to the website and waiting until it reaches plays games and gets a game where it is in the scenario i want to test doesnt feel effcient and takes some time especially if its a rare scenario. so I was wondering if there is a different way to test/debug an algo on a specific scenario that i am not aware of. Thanks in advance!

I wrote myself a simple script, that would input the data from a replay file into my algo. If you look at how the starter kit works, you can see what the algo usually reads in from stdin and you can replace this with data from a replay file. With this approach you can pick a replay where you noticed a bug in your algorithm and feed it back into your algo to debug it. Then you can improve your algo and debug the same replay again, to see it is better then.

This approach guarantees the exact same results then in the live game if:

  1. the time limit was not hit and nothing in your algo is time dependent
  2. your algo is deterministic

If you have a replay file, you can easily upload it to the playground to see visually exactly what happened. If you want to test some scenario that has not happened in a replay, you can just set it up in the playground and download a replay from there.