From: Thomas Leitner Date: 2004-11-04T11:38:47+09:00 Subject: Re: [QUIZ][SOLUTION] Re: Sokoban (#5) On Thu, 4 Nov 2004 10:31:21 +0900 James Edward Gray II wrote: | On Nov 3, 2004, at 6:18 PM, Thomas Leitner wrote: | | > Again, very late, but here is my solution. A central game core and | > two front ends, a curses one and and FXRuby one. | | A nice submission as always Thomas, but just FYI, there is a subtle | bug in it. I've been triggering it by playing level 0, filling the | middle row of storage, then the top and finally the bottom. It will | say I solved it one crate too soon. | | Hope that helps. | | James Edward Gray II | Thanks for pointing out that bug, James! I really enjoyed this quiz because I played Sokoban a lot and always thought it would be difficult to implement ;-) One suggestion for the quiz solutions on your web page: It would be nice if there would be a quiz??-solutions.tar.bz2 file which has all submission in it (each solution in its own directory which is named after the developer). This way it would be much easier to try the solutions. Just my 2 cents. Thomas Leitner Here is the diff to fix the bug: Index: sokoban.rb =================================================================== --- sokoban.rb (revision 5) +++ sokoban.rb (working copy) @@ -121,7 +121,7 @@ end def level_finished? - !( @map.any? {|item| item == Map::Storage } ) + !( @map.any? {|item| item == Map::Storage || item == Map::ManOnStorage } ) end def reset