Check if number of flags is correct

Only the number of correct flags is checked. Also check if the number of
flags is correct as well, so that it won't be possible to win by just
filling the board with flags.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>