Conversation
Implemented an iterative solve-check-block loop in `LitsSolver` to enforce that all shaded cells form a single connected component (polyomino). This mirrors the strategy used in `NurikabeSolver`. Added connectivity assertions to `LitsSolver_test.py` to verify the fix and prevent regression.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
Qodana Community for Python125 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at qodana-support@jetbrains.com
|
… constraints, and re-enable hard path test
This PR addresses the issue where
LitsSolverwould sometimes return solutions with disconnected groups of shaded cells (LITS shapes), violating the puzzle's connectivity rule.Changes:
Domain/Puzzles/Lits/LitsSolver.py:get_solutionto use an iterative loop._add_connectivity_constraintsto dynamically add constraints forbidding disconnected components (lazy constraints).ShapeGeneratorto assist with neighbor identification for component constraints.get_solutionto useGrid.get_all_shapesinstead ofGrid.get_connected_positionsto safely identify connected components withoutStopIterationerrors.Domain/Puzzles/Lits/tests/LitsSolver_test.py:check_connectivityhelper method.test_solution_6x6_normal,test_solution_6x6_hard, etc.) to assert that the returned solution is fully connected.The solution was verified by running the existing test suite, which now explicitly checks for connectivity.
PR created automatically by Jules for task 7783139351858898744 started by @newtomsoft