The damage prediction seems to be off by 1 or 2 sometimes when battling low level Pokemons at the beginning of the game (or always ?).
The items and abilities are not yet integrated in the formula but it should not matter given the tests I made (pidgey vs pidgey/rattata, no useful ability and no item used by anyone).
The code works for the exemple given at the bulbapedia page.
The damage prediction seems to be off by 1 or 2 sometimes when battling low level Pokemons at the beginning of the game (or always ?). The items and abilities are not yet integrated in the formula but it should not matter given the tests I made (pidgey vs pidgey/rattata, no useful ability and no item used by anyone). The code works for the exemple given at the bulbapedia page.