This source code provides a refactoring challenge in kotlin.
- Ensure you can get the tests passing. (You can also run the program, to get an idea of the kind of mazes it generates.)
- Refactor the code until you can find a good name for the variable
q
. Be careful to keep the tests passing at all times! - The code contains at least one bug. Did you spot it while refactoring? Can you fix it (test-first, of course)?
- Think about your refactoring strategy. Do you use particular moves at certain times in the process? Looking back over the whole process, could you describe a refactoring plan for this code to someone else?
- Can you describe the maze-building algorithm used? Can you refactor the code so that some part of it expresses this algorithm? Could you use most of this code to implement one or more alternative algorithms without too much rewriting?
- The original program is by Jack Hauber, and the source is "Basic Computer Games." Used with permission of David Ahl
- This exercise was inspired by Alan Hensel's use of Amazing as a refactoring challenge
- The transliteration to Java is based on one created by Bill Wake.
- The initial code repository, including this README file comes from xpsurgery.