Name: Anonymous 2010-11-20 18:25
I'm solving a sliding puzzle with BFS, and I'd like to practice doing things functionally. Any tips for layout and representation?
I'm storing the board state as an array of strings, one for each row, but the blocks can be of different sizes (1x1, 1x2, 2x1 and 2x2), which makes the code for moving a block pretty ugly.
I'm storing the board state as an array of strings, one for each row, but the blocks can be of different sizes (1x1, 1x2, 2x1 and 2x2), which makes the code for moving a block pretty ugly.