-
Notifications
You must be signed in to change notification settings - Fork 0
Roadmap
BrandonRobare edited this page Jun 2, 2026
·
1 revision
These are real follow-ups I would make if I revisited this code. The repo keeps the labs as submitted, so none of these are applied. They are here for honesty about where the code is rough.
- Several functions can fall off the end without returning a value.
goodDirection,pickAdjacent, andcheckMazeeach return on the branches the program actually hits, but g++ warns that other paths reach the closing brace. Add explicit return values. -
srand(time(nullptr))is called insideRoom::pickandRoom::pickAdjacent. Seeding once at the start ofmainis the right place, and reseeding from the same second's clock value hurts randomness. - In
Maze::move, theelseguards only thecout, whilereturn falseruns every time because of the brace layout. Wrap the two statements so the wall message and the early return belong together. - The generator never checks that the cheese is reachable from the start, so a random board can seal the cheese off. Add a connectivity check, or switch to carving passages so every room stays reachable.
- The display lists wall coordinates instead of drawing a grid. Render an ASCII board so the layout is readable while playing.
-
nextMoveandcreateAdjacentcallexit(0)on unexpected input. Returning a quit sentinel and lettingmaindecide would be cleaner.
-
addNumberandremoveNumberrelease the old array withdeleteinstead ofdelete[]. Use the array form to matchnew[]. -
removeNumberallocatessize_ + 1doubles when the result needssize_ - 1. Size the new array correctly. -
checkkeeps scanning after it finds a match. Returning early would stop the loop sooner. Minor, since the collection holds no duplicates.
- Add a few automated checks. The CI workflow proves both projects compile, but it does not run them. Feeding scripted input and comparing output would catch regressions.