Sadly the link seems to be of little value, as for me I got an introduction into the level and some default code.
In general what you did is the compact way. The compact way is, well, compact, but does not facilitate readability.
Maybe there is a part in there which causes floating point problems or something.
However, it has already been reported for other gamemodes that the result you see does not have to correspond with the computed result. It is currently not exactly known why that is, but as the results are cloud-computed a wide-scale cheating seems unlikly (unless someone set up a dozen computers to simulate biased matches, in which I’d leave them be. I mean who got a dozen computers for something like this?).
The only solution I can propose is to try and look at other matches, hoping they show the actual happenings.
Other thread about this:
http://discourse.codecombat.com/t/cavern-survival-optimal-strategy-game-breaking/2002/19?u=j_f_b_m