Skip to content

Fix Fillomino [?] region size validation (fixes #462)#697

Merged
x-sheep merged 3 commits intorobx:mainfrom
mashinosatoshi:fix/issue-462_fillomino-question-regions
Mar 25, 2026
Merged

Fix Fillomino [?] region size validation (fixes #462)#697
x-sheep merged 3 commits intorobx:mainfrom
mashinosatoshi:fix/issue-462_fillomino-question-regions

Conversation

@mashinosatoshi
Copy link
Copy Markdown
Contributor

Description

This PR fixes issue #462, where two ? regions of the same size touching each other incorrectly passed the answer check without raising a bsSameNum error in Fillomino.

Root cause

When a region is composed entirely of ? markers, its logical number in the graph was evaluated as -2. During the adjacent area matching (checkSideAreaNumberSize), values <= 0 are skipped to avoid false flags. As a result, identical-size ? regions did not trigger the validation for "same size area sharing an edge".

Fix details

Updated the graph generation logic so that it assigns the current area size (clist.length) as the region's number when it consists exclusively of ?. This makes its behavior consistent with empty cell regions, ensuring the adjacent size comparison works correctly and errors are properly flagged.

A test case proving this validation fix has been added in test/variety/fillomino_test.js.

Fixes #462

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 23, 2026

@mashinosatoshi is attempting to deploy a commit to the robx's projects Team on Vercel.

A member of the Team first needs to authorize it.

@x-sheep x-sheep self-assigned this Mar 24, 2026
@x-sheep x-sheep self-requested a review March 24, 2026 17:31
@x-sheep x-sheep removed their assignment Mar 24, 2026
@x-sheep x-sheep added the bug Something isn't working label Mar 24, 2026
Copy link
Copy Markdown
Collaborator

@x-sheep x-sheep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request. While question marks should generally be avoided completely in finished puzzles, there's no harm in fixing the issue of course.

@mashinosatoshi
Copy link
Copy Markdown
Contributor Author

Thank you for your review.
Please check changes.

@x-sheep x-sheep self-requested a review March 25, 2026 15:38
@x-sheep x-sheep merged commit c1ef44a into robx:main Mar 25, 2026
1 of 2 checks passed
@x-sheep
Copy link
Copy Markdown
Collaborator

x-sheep commented Mar 25, 2026

Thanks!

@mashinosatoshi mashinosatoshi deleted the fix/issue-462_fillomino-question-regions branch March 28, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fillomino ? regions bug

2 participants