170 likes | 266 Views
Learn the rules and strategies of Heyawake puzzle game, involving black and white cells in rooms. Discover contradictions and derived rules to solve puzzles effectively.
E N D
Heyawake Rules and strategies. Matt Morrow
Heyawake Rules • 1a) Each “room” must contain exactly the number of black cells as stated. Rooms without numbers can have any amount of black cells • 1b) A single line of white cells cannot be in more than 2 rooms. • 1c) No 2 black cells can be adjacent to each other • 1d) All white cells must connect
Heyawake Contradictions In violation of 1a) Each “room” must contain exactly the number of black cells as stated: 2a1) There are fewer black cells in a completely filled room than the room number states 2a2) There are more black cells in a completely filled room than the room number states White = Open Black = Closed Gray = Unknown
Heyawake Contradictions In violation of 1b) A single line of white cells cannot be in more than 2 rooms: 2b) A single line of white cells is in more than 2 rooms White = Open Black = Closed Gray = Unknown
Heyawake Contradictions In violation of 1c) No 2 black cells can be adjacent to each other: 2c) 2 black cells are adjacent to each other White = Open Black = Closed Gray = Unknown
Heyawake Contradictions In violation of 1d) All white cells must connect: 2d) Some white cells are closed in by black cells White = Open Black = Closed Gray = Unknown
Heyawake Derived Rules Derived from 2a1): 3a1) If the number of unknown cells equals the number of remaining black cells, all unknown cells in the room are black. White = Open Black = Closed Gray = Unknown
Heyawake Derived Rules Derived from 2a2): 3a2) If the number of black cells in a room = the desired number, all other squares in the room are white. White = Open Black = Closed Gray = Unknown
Heyawake Derived Rules Derived from 2b): 3b) A line of white which originates in a room and then enters another room must encounter a black square before it can enter a third room. White = Open Black = Closed Gray = Unknown
Heyawake Derived Rules Derived from 2c): 3c) All adjacent squares around a black cell are white. White = Open Black = Closed Gray = Unknown
Heyawake Derived Rules Derived from 2d): 3d) A white cell which is blocked on 3 sides (by border or black cells) must have its remaining side white. White = Open Black = Closed Gray = Unknown
(2x-1)-by-1 Room Rule An area which must contain x black cells and whose dimensions are 1 by (2x-1) can only have one configuration: black cells at the ends, and then alternating black and white cells. This can be derived from repeated 3a1 and 3c. White = Open Black = Closed Gray = Unknown
Inside x-by-2 Room Rule An area which must contain x black cells and whose dimensions are 2 by x has exactly 2 configurations (3a1, 3c) Since no cell can be adjacent to another, there can only be 1 cell per row and they must zigzag. White = Open Black = Closed Gray = Unknown
Outside x-by-2 Room Rule We can use a 2 by x area containing x for a proof by cases since we know the configuration can either be one way or the other. (uses 3d and Inside x-by-2) White = Open Black = Closed Gray = Unknown
3-by-2 Border Room Rule A 3-by-2 room next to the border has only one solution: Use Inside x-by-2 rule for cases Contradiction! (2d) White = Open Black = Closed Gray = Unknown Red = Wall
Heyawake Room Cases In a 3 by 3 area with 4 remaining, if a black cell is a middle edge cell, all the black cells must be middle edge cells (3d, Inside 3-by-2). This results in a single white cell completely surrounded by black. ┴ (2d) therefore none of the middle edge cells can be black and must be white. The only way in which 5 black squares can fit in a 3 by 3 is in the following configuration: White = Open Black = Closed Gray = Unknown Red = Wall
LEGUP Issue • Heyawake is region based • Need a class which would be like the boardstate class where this could be loaded and checked • Not necessary for the regions to change • Is this reasonable to assume for all puzzles? (killer sudoku) • Regions need to have a draw outline function • How would we represent a region?