Log In  

Here's an implementation of the sliding block puzzle 'Hua Rong Dao', otherwise known as 'Klotski'. It has has been adopted in a number of countries, each giving it a different story. You can read about it here: @

(EDIT: updated to be solvable!)

[code]
Title: Hua Rong Dao
Author: Unknown
Difficulty: 5
Wall: 4
Floor: 3
Validation: 7a501b4
-----------------------------
. # # # # # # # # # # # # # . 
. # # # # # # # # # # # # # . 
. # # # F F W W W W D D # # . 
. # # # F F W W W W D D # # . 
. # # # F F W W W W D D # # . 
. # # # F F W W W W D D # # . 
. # # # 0 0 0 0 0 0 S S # # . 
. # # # 0 0 0 0 0 0 S S # # . 
. # # # 0 0 0 0 0 0 S S # # . 
. # # # 0 0 0 0 0 0 S S # # . 
. # # # 0 0 . . . . 0 0 # # . 
. # # # 0 0 . . . . 0 0 # # . 
. # # # # # . . . . # # # # . 
. # # s d W W # # W W w f # . 
. # # # # # # # # # # # # # . 
-----------------------------
Groups: AABBBBAABBBBAACCDDAACCDDEEFFEEFF    
-----------------------------
[/code]
Cart #1006 | 2010-10-01 | Embed ▽ | No License

P#113 2007-04-15 05:49 ( Edited 2007-04-15 09:49)

Has anyone solved this one? I believe the level posted above is impossible. I wrote a computer program to do an exhaustive search for the solution, and it verified the puzzle is impossible (if I'm not mistaken).

The above level is not an entirely faithful implementation of Hua Rong Dao, I think, because the White chocolate can stick in the lower left or lower right corners.

I made a small modification (shown below) to make the puzzle solvable.

[code]
Title: Hua Rong Dao
Author: Unknown
Difficulty: 5
Wall: 4
Floor: 3
Validation: 7a501b4
-----------------------------
. # # # # # # # # # # # # # . 
. # # # # # # # # # # # # # . 
. # # # F F W W W W D D # # . 
. # # # F F W W W W D D # # . 
. # # # F F W W W W D D # # . 
. # # # F F W W W W D D # # . 
. # # # 0 0 0 0 0 0 S S # # . 
. # # # 0 0 0 0 0 0 S S # # . 
. # # # 0 0 0 0 0 0 S S # # . 
. # # # 0 0 0 0 0 0 S S # # . 
. # # # 0 0 . . . . 0 0 # # . 
. # # # 0 0 . . . . 0 0 # # . 
. # # # # # . . . . # # # # . 
. # # s d W W # # W W w f # . 
. # # # # # # # # # # # # # . 
-----------------------------
Groups: AABBBBAABBBBAACCDDAACCDDEEFFEEFF    
-----------------------------
[/code]
Cart #1023 | 2010-10-01 | Embed ▽ | No License

P#242 2007-06-28 10:02 ( Edited 2007-07-03 15:50)

You're completely right, Carbuncle! My profuse apologies to anyone who tried to solve it manually! I've copied the solvable version over the original post to avoid confusion.

That's neat that you could do an exhaustive search - I would have thought the state space would be massive at that depth. Does your program work for arbitrary chocolate-only CC puzzles? (-:>

P#243 2007-06-28 21:16 ( Edited 2007-07-03 15:50)

Here's a replay of the solution taken from @

Chocolate Castle Recording
Room: 0  Set: 0  Moves: 87  Len: 435  Chash: 58de
Mbb9bMa9abM87a7M797bM5979M4a48M6a4aM797b
M9656M99b7M8a86M7999M597bM6769M8747Mb777
Mb9b7M9896M7abaM5a9aM797bM7759M9979Ma888
Ma5a9M7494M4464M5652M4844M7858M7478M9575
Ma8a4M97b7M9a96Maa88M7bbbM585aM787aM8646
M7375M5393M5472M5652M5a56M6949M896bM8688
M9274Ma585Mb7b3M87a7M7579M7375M5373M5553
M5957M7a5aM797bMa989Ma5a9M94b4M7494M7393
M5373M5753M7757M9599M9397Ma484Mb8b4M98b6
Maaa8M7abaM5a9aM686aM9757Mb777M9896M9ab8
M597aMbdadM7799M644aM4d83Mcd54M3da3

P#244 2007-06-28 21:25 ( Edited 2007-07-03 15:50)

My program doesn't work for arbitrary Chocolate Castle puzzles. It only searches to see if the white chocolate can be brought to the bottom centre of the rectangle, so the search doesn't involve eating any chocolate. The number of possible states before the white chocolate gets eaten is definitely small enough to search through, since the pieces are so tightly packed into the rectangle.

The number of possible states after eating the white chocolate is pretty immense, but finishing the puzzle once you've successfully eaten all the white chocolate is pretty easy, so I didn't search past the eating of the white chocolate.

Chocolate Castle is a wonderful (and well-implemented) framework for many interesting puzzles. I seem to remember there was a post about a "Rush Hour" puzzle implemented in Chocolate Castle, but I can't seem to find it anymore. Was it just my imagination?

P#245 2007-06-29 04:44 ( Edited 2007-07-03 15:50)

Ah, that's interesting. I was contemplating writing a solver to use as a design tool, but let it go for fear of large search spaces (and tricky heuristics). Can I ask - how long did it take to solve Hua Rong Dao? I have an idea for generating a batch of similar puzzles automatically (:

I can't remember the post, but the Rush Hour puzzle would be level 20 in the hard set. It has pieces which can only move along one axis.

P#246 2007-06-30 09:14 ( Edited 2007-07-03 15:50)

It solved Hua Rong Dao fairly quickly, in less than a second. Just a few simple optimisations will cut the whole search down to less than 30,000 states. For example, for the purpose of eliminating permutations of identical blocks, I considered the four vertical 2 by 4 blocks to be identical, even though they are made of different materials.

P#247 2007-07-01 07:05 ( Edited 2007-07-03 15:50)

Hey that's not bad at all. I might have a go at a simple puzzle generator after all. I know there are some players hungy for more puzzles lurking around here. (:

P#253 2007-07-02 09:17 ( Edited 2007-07-03 15:50)

So we're hungry for more Chocolate, are we? I dunno, that pun might have spoilt my appetite...

The correction was a moot point for me, as I couldn't solve even the fixed version without looking at the available solution; I'd find it easier to write a solver like Carbuncle's. As for generated puzzles, I find the variety and ingenuity of the CC sets to be a lot of the charm. Then again, I still play Neko, so what do I know?

P#257 2007-07-03 09:21 ( Edited 2007-07-03 15:50)

Argh, I don't mean to keep making those puns, really!

Yes, generated puzzles are likely to be quite bland ( <-- !pun ), but it might be possible in this case to inject some human guidance into it. For example - choosing some piece shapes that might be interesting.

P#258 2007-07-03 10:50 ( Edited 2007-07-03 15:50)

Hmnn.. maybe it would be easier just to create a 'shuffle' tool that you can use during the game, and then keep the modified puzzle in the editor as Gray suggested a while ago. That way you can put the pieces in a good ending position and work backwards.

P#259 2007-07-03 11:01 ( Edited 2007-07-03 15:50)

The result: @

P#261 2007-07-03 11:50 ( Edited 2007-07-03 15:50)

[Please log in to post a comment]