chiark / gitweb /
Compare against n_max_frags with <=, not <.
authorSimon Tatham <anakin@pobox.com>
Mon, 10 Mar 2014 18:39:43 +0000 (18:39 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 10 Mar 2014 18:39:43 +0000 (18:39 +0000)
commit3ce6aa311aeb65718b1674c2bc0d2f548f7801c5
tree815f3764fc4d7a8c34adad97ba038f73fa9a93e2
parent13849e71956f8a3a2142cadd24c4f2006a328a04
Compare against n_max_frags with <=, not <.

It would be legal to use < if n_max_frags was exactly equal to n/best
(in that case we would know that dividing a stick into that many
pieces could at best equal the existing best score), but not if it's
merely floor(n/best) since then we might have previously seen an
_uneven_ dissection of a stick into that many pieces, which could be
beaten by an even one.

Reinstates the ability to do 7 into 4 with score 5/3 instead of the
3/2 reported by the previous version.
main.c