A long time ago, when I was new to the concept of refactoring code, one of the practice projects that I tried was cleaning up some really horrible maze generating code. “Horrible” in that it was a BASIC program ported to Java.
Also a long time ago, I converted that Java port over to C#. If you want to try that version yourself, you can get the code from GitHub.