chiark / gitweb /
Aha! It turns out, after a bit of failure-mode profiling, that when
authorSimon Tatham <anakin@pobox.com>
Tue, 31 May 2005 18:09:28 +0000 (18:09 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 31 May 2005 18:09:28 +0000 (18:09 +0000)
commit739609cec2262017aaabb7e34ce75af784fd683c
treeb0c6b49f3e80e6c6712418f8ab9d1ff6f9329ffd
parentc11f9ff173763e92155838d79a5ea130c5693540
Aha! It turns out, after a bit of failure-mode profiling, that when
the Mines unique grid generator fails at high mine densities it is
_almost always_ for the same reason, and it also turns out that this
reason is one which can be addressed. So here's an enhancement to
mineperturb() which enables Mines to generate a grid at (as far as I
can tell) any mine density you like, up to and including w*h-9
mines. At densities of 1 in 2 or thereabouts the grids start to look
rather strange, but it can at least generate them without hanging.

[originally from svn r5885]
mines.c