raccrompton / BookBuilder

An automatic Chess opening repertoire Builder
GNU General Public License v3.0
126 stars 18 forks source link

fix boolean statements in calc_percs #1

Closed tkfu closed 2 years ago

tkfu commented 2 years ago

((n > 0) and (config.DRAWSAREWINS)) == 0 has the opposite of the intended behaviour because of misplaced parentheses. If n = 0 and config.DRAWSAREWINS is also 0, this whole statement evaluates to true (because False and 0 evaluates to False, but False == 0 evaluates to true). This leads to divide-by-zero errors.

This PR reinstates the intended behaviour.

raccrompton commented 2 years ago

Thanks, just added this so didn’t catch it =D