jpd236 / kotwords

Collection of crossword puzzle file format converters and other utilities, written in Kotlin.
Apache License 2.0
25 stars 6 forks source link

Snake Charmer grid entry #10

Closed Nathan-tortoise closed 3 years ago

Nathan-tortoise commented 3 years ago

When entering a Snake Charmer with a custom grid, if the first row does not begin with a space character, it returns the error Error generating JPZ: First row of grid must contain a white square ('*'). For example, try creating a Snake Charmer with entries:

SNAKE DREAMING OTTER RAPIERS NAKED REAM INGOT TERRA PIER

clues:

Serpent
Fantasizing
Aquatic mammal
Swashbucklers' weapons
Bare
Quantity of paper
Metal bar
___ cotta
Dock

And grid:

*****
*   *
*   *
*   *
*   *
*   *
*   *
*   *
*****

Clearly, the grid as entered does contain white squares (*) in the first row, so it shouldn't return this error. In this case, altering the grid so that the first row begins with a space character will work correctly:

 ****
**  *
*   *
*   *
*   *
*   *
*   *
*   *
*****

But if the grid is tightly packed, this can only be achieved by adding a space character in front of every row, which creates a seemingly unnecessary column of black squares in the rendered JPZ.

Ideally, the text field should allow for the first row to not begin with a space character; barring that, the parser should remove columns of black squares on the edges of the rendered grid. If these cannot be done due to how the text entry is parsed, please update the help text to indicate that the first row must begin with a space character.

jpd236 commented 3 years ago

Thanks - there was an off-by-one error that prevented the top-left square from being a white square, which as you noted is perfectly valid. Fixed, pushed, and verified that your example puzzle is now working. Appreciate the detailed report!