5 kyu

Sokoban re-solver : level recovery from solution

Description
Loading description...
Game Solvers
Games
Puzzles
Algorithms
  • Please sign in or sign up to leave a comment.
  • Davo36 Avatar

    Man, I must be looking at this one strangely. I can get the level, but the border around the outside is very difficult to do. Seems like a level 3 kata to me. Must be missing something.

    • grigr Avatar

      my algorithm restores the level so that you don't have to remove extra walls. but I knew that someone will face this problem. you can make an additional algorithm for filling empty spaces to remove extra walls. or rebuild the logic of your algorithm.

      when I created the kata, I suggested rank 4. but those who decided it first changed to level 5. Apparently for some this is a very simple task.

  • Avanta Avatar

    Hi again, your random test generator can very occasionally generate an empty string for the input. Eg. for a 6x6 grid, around 1 in 10 generate an input as an empty string. However, this chance does decrease as you increase the grid size so it's very rare for it to happen in the random tests.

    Also, this isn't so much as issue, but could you be able to make the random test generator any faster. It's currently quite slow :P

  • dfhwze Avatar

    Are you looking for the initial level setup or the solved level?

  • Avanta Avatar

    This comment has been hidden.

  • Voile Avatar

    There are infinite levels that can satisfy the solution, but the kata never specifies which one should be considered correct. It's only well-defined and unique if you require

    • Minimal amount of free space inside the outer bound
    • Minimal amount of boxes
    • Outer bound must be of thickness of 1, connected orthogonally and minimal
    • The level must be drawn with no extra spaces on either side

    And possibly more conditions.

  • Mercy Madmask Avatar

    Can the solution contain movement (lowercase) against a box?
    If yes, should we ignore them?

  • hobovsky Avatar

    This comment has been hidden.

    • grigr Avatar

      This comment has been hidden.

    • Avanta Avatar

      This comment has been hidden.

    • hobovsky Avatar

      Meaning of such solution is that I can solve your kata without writing a solution, just by inspecting inputs, or by reading failure messages.

      It is true that for some types of tasks, for example game simulators and game solvers, it can be difficult to come up with a generator of random test cases. If you'd like some help on this topic, you can find some on #help-author channel of Codewars Discord. If you don't want to join Discord, I can drop some ideas here if you prefer.

    • grigr Avatar

      I understood you. I need to think 1-2 days. most likely I can make a simple generator. Thanks

    • Avanta Avatar

      This comment has been hidden.

    • grigr Avatar

      Thank you. I'll try a slightly different way. Though I think your algorithm will work too.

    • grigr Avatar

      I made a level generator! it looks like a standalone kata. this is an interesting task

    • grigr Avatar

      I update test script.

      Issue marked resolved by grigr 3 years ago
    • lsnbr Avatar

      Sokoban re-solver would also be an interesting kata :D

    • grigr Avatar

      soko-solver this is very-very hard task... possible for small levels

    • grigr Avatar

      after I added random level generation, three solutions became "invalidated". apparently they run again after adding new tests.

      I was also interested in a new problem for solving small levels. maybe I'll do it...

    • grigr Avatar

      i wrote a simple soko-solver. it works with brute-force. unfortunately it is still very slow. if I manage to optimize it, it will probably be a great kata :)