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

New 'Shared Light Bulbs' rule for LightUp #96

Closed Bram28 closed 6 years ago

Bram28 commented 7 years ago

Here is a common pattern that I often use when doing Lightups, but for which we don;t have a rule yet. Say you have a '1' and a '3' diagonally across from each other. Since it can't be the case that the two shared adjacent cells both have a lightbulb (for that violates the '1'), nor that neither has a lightbulb (because that'll violate the '3'), it must be the case that the two shared cells have exactly 1 lightbulb between them .... which means that the two other adjacent cells for the '1' don't have a lightbulb, and the other two cells for the '3' both have a lightbulb.

This rule can be extended for other situations, e.g. you have a '2' on the side of the grid diagonally across from a 1: the non-shared cell of the '2' will definitely have a lightbulb, and the non-shared cells for the '1' definitely not.