Bram28 / LEGUP

Logic Engine for Grid-Using Puzzles - a better way to learn formal logic
GNU Affero General Public License v3.0
2 stars 8 forks source link

Nurikabe: Bottle Neck White #68

Closed Bram28 closed 9 years ago

Bram28 commented 9 years ago

We need a Bottle Neck White rule:

A cell is forced to be white if making it black would cause a Region Too Small or No Number contradiction (note that the No Number contradiction rule needs to be extended to allow for blanks).

mmellone commented 9 years ago

It's almost done, however it appears there is a bug when extending a white region to a border. The contradiction part of it is working, so not sure why the rule isn't. I'll try to debug it.

22c40059d3bbae29fd01d210dbd4ba0d44bbefe5

mmellone commented 9 years ago

953a281d1f2f81c53239a233a6880bc7e04fb9f0

Fixed the bug. It was actually an error in how the rule checks each contradiction. A combination of two mistakes made it seem that the rule mostly worked when if fact it didn't. Anyway, it appears that this rule is working as it should.

Bram28 commented 9 years ago

Not quite ... Given that the No Number Contradiction checks out here ...

no number ok

the corresponding Bottle Neck White should check out, but it doesn't:

white bottle neck bug

And yes, the added white cell leads to a contradiction with the 1, but the White Bottle Neck Rule should not be checking for that; we would use a separate Contradiction rule to point that out.

mmellone commented 9 years ago

My mistake, I took the check for the Too Many Spaces contradiction out of the white bottle neck rule.

b1a5a4ec1140163bc9962e6d5eb8911fa2687ade

Bram28 commented 9 years ago

Ah! Yes, it should just check for any Too Few Spaces or No Number contradictions.

Bram

From: Mitchell Mellone [mailto:notifications@github.com] Sent: Wednesday, February 04, 2015 12:03 PM To: Bram28/LEGUP Cc: Van Heuveln, Bram Subject: Re: [LEGUP] Nurikabe: Bottle Neck White (#68)

My mistake, I took the check for the Too Many Spaces contradiction out of the white bottle neck rule.

b1a5a4ehttps://github.com/Bram28/LEGUP/commit/b1a5a4ec1140163bc9962e6d5eb8911fa2687ade

— Reply to this email directly or view it on GitHubhttps://github.com/Bram28/LEGUP/issues/68#issuecomment-72893586.

Bram28 commented 9 years ago

Works! Thanks Mitchell!