Today I am very happy I made the effort to set up a development environment that makes explorative programming easy, and that I chose Scheme. It really pays off!
I have been experimenting with the algorithm for finding all hexagons that a unit can reach in one turn, and being able to see the effect of changes to the algorithm immediately–without restarting–makes it possible to work so much faster. You do not just get rid of the compilation time, you also do not have to set up your test case again after each restart, and having an uninterrupted work flow makes it easier to focus on the problem.
The purpose of the changes I made were to make it easier to block the opponent’s path with your troops. Until now, you could squeeze yourself in between enemy tanks, meaning the defender would have to have a completely air-tight front where every unit stood next to another to block your path.
The first screenshot illustrates the change. Previously, the blue tank was able to reach the hexes in the south by passing through the hexes between the enemy tanks. Now it takes half as many units to block the path, since the tank cannot pass through narrow passages that are bordered by enemies.

The second screenshot shows a situation where a tank has been surrounded by a circle of enemies which it cannot leave without a fight.
One of the reasons explorative programming was so useful here was that I was not sure exactly what I wanted when I started. I defined and redefined the problem as I was solving it. What counts as a narrow passage? Should you be able to step into hexes squeezed between enemies, but not pass through them? Should passage through hexes that are placed between the sea and an enemy be blocked too, or just hexes that are placed between two enemies? These questions would have taken much longer to answer had I used C++.

