P.S. How is it possible for the program to have exceptions in the form of repeatable battles on certain maps? That is, in one battle, the program remembers this value (R), but in another, it doesn't? There must be a specific algorithm, we just can't understand it (hopefully not yet), because it's not that simple and straightforward.
As our tests have shown, in some cases, a 100% repeatable battle is possible after fleeing. A prime example: the task from Fireball. In these cases, the first battle of any session can be anything, but starting with the second, the battle map repeats again and again and does not depend on the session number!
So, your Hero has left the battlefield, and you have reloaded. What are the conditions for the battle to repeat 100% after reloading?
It turns out that it is both simple and strange at the same time:
If the enemy hero gains one or more experience levels in the battle from which your hero fled, then all battles, starting with the second, will become constantly repeating battles (repeatable battles, VDV_forever).
So, in the task we are considering, Agar has level 8 (10000 xp). If he doesn't manage to kill 1000 xp to reach level 9, then there will be no repeatable battle! If he does manage to reach level 9, then the repeatable battle will be 100%! Moreover, the type of repeatable battle depends on how many levels the enemy hero gains in the battle.
Therefore, any battle with a hero can be divided into several parts:
1) the enemy hero did not kill enough creatures to reach the next level;
there will be no repeatable battle.
2) the enemy hero killed enough creatures to reach the next level;
the repeatable battle will be 100%.
3) the enemy hero killed enough creatures to gain several levels at once;
the repeatable battle will be 100%, although its type will depend on the number of levels gained.
In a battle with neutrals, obviously, there can be no question of a repeatable battle.
That's the way it is.