Skip to content

Nurikabe Test Suite Docs

Keshav edited this page Nov 21, 2023 · 3 revisions

Symbol Key

X - Unknown Cell
B - Black Cell
W - White Cell
2,3,... - Numbered Cell

Individual cells within grids are referenced with (x,y), where x is the column number and y is the row number.
Row indexing begins with 0 at the top, and increases towards the bottom.
Column indexing begins with 0 at the left, and increases towards the right.

Direct Rule Tests

Black Between Regions - NURI-BASC-0001

Test Case 1 - Diagonal Black Between Regions 1:
XXXX
X4BX
XB5X
XXXX

  • Checks if the rule correctly detects black between regions, when the regions are diagonally opposite in the top-left to bottom-right direction

Test Case 2 - Diagonal Black Between Regions 2:
XXXX
XB4X
X5BX
XXXX

  • Checks if the rule correctly detects black between regions, when the regions are diagonally opposite in the bottom-left to top-right direction

Test Case 3 - Horizontal Black Between Regions:
XXX
4B5
XXX

  • Checks if the rule correctly detects black between regions, when the regions are horizontally opposite

Test Case 4 - Vertical Black Between Regions:
X4X
XXX
X5X

  • Checks if the rule correctly detects black between regions, when the regions are vertically opposite

Test Case 5 - False Black Between Regions:
5WW
WBW
XXX

  • Checks that the rule does not erroneously detect black between regions at (1,1)

Black Bottle Neck - NURI-BASC-0002

Test Case 1 - Simple Bottle Neck:
XWB
WBB
XWX

  • Checks if the rule correctly detects a black bottle neck at (2,1)

Test Case 2 - Corner Bottle Neck:
BWB
BXX
XXX

  • Checks if the rule correctly detects a black bottle neck from the corner at (0,1)

Test Case 3 - False Bottle Neck:
BWX
BWX
XXX

  • Checks if the rule detects that there is no bottleneck at (0,1)

Corner Black - NURI-BASC-0003

Test Case 1 - Simple Corner Black:
BXB
B2X
BBX

  • Checks if the rule correctly detects a corner black at (2,0)

Test Case 2 - False Corner Black:
BXB
B2X
BXX

  • Checks that the rule does not erroneously detect a valid application of the rule at (2,0)

Fillin Black - NURI-BASC-0004

Test Case 1 - Unknown Surround Black:
XBX
BBB
XBX

  • Checks if the rule correctly detects a black fillin at (1,1)

Test Case 2 - Corner Test 1:
BBX
BXX XXX

  • Checks if the rule correctly detects a black fillin in the corner at (0,0)

Test Case 3 - Corner Test 2:
XXX
XXB
XBB

  • Checks if the rule correctly detects a black fillin in the corner at (2,2)

Test Case 4 - False Fillin Black:
XBX
BBX
XB2

  • Checks that the rule does not erroneously detect a valid application of the rule at (1,1)

Fillin White - NURI-BASC-0005

Test Case 1 - Unknown Surround White:
BWX
WWW
XWX

  • Checks if the rule correctly detects a white fillin at (1,1)

Test Case 2 - Corner Test 1:
WWX
WBX XXX

  • Checks if the rule correctly detects a white fillin in the corner at (0,0)

Test Case 3 - Corner Test 2:
XXX
XBW
XWW

  • Checks if the rule correctly detects a white fillin in the corner at (2,2)

Test Case 4 - False Fillin White:
2WX
WWW
XXX

  • Checks that the rule does not erroneously detect a valid application of the rule at (1,1)

Prevent Black Square - NURI-BASC-0006

Test Case 1 - Bottom Left White:
BB
WB

  • Checks if the rule correctly detects a prevented black square, with white inserted at (0,1)

Test Case 2 - Bottom Right White:
BB
BW

  • Checks if the rule correctly detects a prevented black square, with white inserted at (1,1)

Test Case 3 - Top Left White:
WB
BB

  • Checks if the rule correctly detects a prevented black square, with white inserted at (0,0)

Test Case 4 - Top Right White:
BW
BB

  • Checks if the rule correctly detects a prevented black square, with white inserted at (1,0)

Test Case 5 - False Black Square:
BBX
WXX
XXX

  • Checks that the rule does not erroneously detect a valid application of the rule at (1,1)

Surround Region - NURI-BASC-0007

Test Case 1 - Surround Region Black:
XBX
BWB
XBX

  • Checks if the white cell at (1,1) is entirely surrounded by black

Test Case 2 - Surround Region Black in Corner:
WBX BXX XXX

  • Checks if the white cell in the corner at (0,0) is entirely surrounded by black

Test Case 3 - False Surround Region:
XXX
XWX
XXX

  • Checks that the rule does erroneously detect a valid application of the rule

Cannot Reach Cell - NURI-BASC-0008

Test Case 1 - Simple Unreachable Cell:
BXX
XXX
XX4

  • Checks if the rule correctly detects an unreachable cell at (0,0)

Test Case 2 - All Cells Reachable:
BBBBB
2BBB2
BBBBB
BB5BB
BBBBB

  • Checks if the rule correctly determines that all cells are reachable

White Bottle Neck - NURI-BASC-0009

Test Case 1 - Simple White Bottle Neck:
XBX
B2W
XBX

  • Checks if the rule correctly detects a white bottle neck at (2,1)

Test Case 2 - False Bottle Neck:
WXXXXXXXXW
XXXXXXXXXX
XXX2X5XXXX
XXXXXXX3XX
XXXXX9XXXX
XXXX8XXXXX
XX4XXXXXXX
XXXX3X2XXX
XXXXXXXXXX
WXXXXXXXXX

  • Checks if the rule correctly detects that there is no bottle neck at (0,0)

Test Case 3 - Secondary False Bottle Neck:
XBX
X2W
XBX

  • Checks that the rule does not erroneously detect a valid application of the rule at (2,1)

Contradiction Rule Tests

Black Square - NURI-CONT-0001

Test Case 1 - Simple Black Square:
XXXX
XBBX
XBBX
XXXX

  • Checks if the rule correctly detects a black square in the middle of the board

Test Case 2 - Corner Black Square:
XXXX
XXXX
XXBB
XXBB

  • Checks if the rule correctly detects a black square in the corner of the board

Test Case 3 - False Black Square:
XXXX
XBBX
XBXX
XXXX

  • Checks that the rule does not erroneously detect a contradiction

Unreachable White Cell - NURI-CONT-0002

Test Case 1 - Simple Unreachable Cell:
4XX
XXX
XXW

  • Checks if the rule correctly determines that the cell at (2,2) is unreachable

Test Case 2 - All Cells Reachable:
3XXXW
WXXXX
XXXX3
XXXWX
XXXXX

  • Checks that all white cells are reachable

Isolate Black - NURI-CONT-0003

Test Case 1 - Simple Isolated Black:
BXW
XWX
WXB

  • Checks if the rule correctly detects isolated black squares at (0,0) and (2,2)

Test Case 2 - Diagonal Black:
BWX
WBW
XWB

  • Checks if the rule correctly detects diagonally connected isolated black squares at (0,0) (1,1) and (2,2)

Test Case 3 - False Isolate Black:
BXB
XXX
XXX

  • Checks that the rule does not erroneously detect a contradiction

Multiple Numbers - NURI-CONT-0004

Test Case 1 - Linear Region Multiple Numbers:
4W4
XXX
XXX

  • Checks if the rule correctly detects the multiple numbers at (0,0) and (2,0) within the linear region of white cells

Test Case 2 - Complex Region Multiple Numbers:
6W6W6
XXWXX
XXXXX
XX5WX
XXWW5

  • Checks if the rule correctly detects multiple numbers at (0,0) (2,0) (4,0) (2,3) (4,4) within more complex regions

Test Case 3 - False Contradiction:
4WXX
WWXX
XX4W
XXWW

  • Checks if the rule correctly determines that there is no contradiction

No Number - NURI-CONT-0005

Test Case 1 - No Number Surround Black:
XBX
BWB
XBX

  • Checks if the rule correctly detects a white region at (1,1) surrounded by black

Test Case 2 - All Cells Reachable:
WB7
XBX
XWX

  • Checks if the rule correctly detects no contradiction in the board

Test Case 3 - False No Number:
XBBX
BWXB
BX3B
XBBX

  • Checks if the rule correctly detects no contradiction in the board

Too Few Spaces - NURI-CONT-0006

Test Case 1 - Completely Enclosed Number:
XBX
B2B
XBX

  • Checks if the rule correctly detects a completely enclosed isolated number at (1,1)

Test Case 2 - Enclosed Region:
BBB
W4W
BBB

  • Checks if the rule correcly detects a region with insifficient space

Test Case 3 - False Too Few Spaces:
XBXXX
B2BXX
BWBX4
XBXXX
XXXXX

  • Checks if the rule correctly detects no contradiction in the board

Too Many Spaces - NURI-CONT-0007

Test Case 1 - Extraneous Space:
XWX
W2W
XWX

  • Checks if the rule correctly detects a region with too many white cells

Test Case 2 - Extra Diagonal Space:
2WB
BBW
XXX

  • Checks if the rule correctly detects that there is no contradiction

Case Rule Tests

Black Or White - NURI-CASE-0001

Test Case 1 - Simple Black or White:

Input Board:
XXX
XXX
XXX

Generated Boards:
WXX
XXX
XXX

BXX
XXX
XXX

  • Checks that the rule correctly correctly generates two boards that have the same size as the initial board.
  • Checks that the two generated boards have the same size, and are identical except for cell (0,0) which must be either black or white.
  • Checks that (0,0) is different for both boards.
Clone this wiki locally