You need to improve your code to prevent the possibility of simultaneous attack from opposite sides. However you envision the creatures behaving, this is a game, so the point is it must always be at least possible to win.
I've updated with v1.1.0 which should prevent the monsters from attacking on opposite sides at the same time.