In addition to everything mentioned in Toby Speight's review:
This program can use at least one additional class and probably more. The class that is obviously missing is Game
. The class Game
should be responsible for loading the game from a file, saving the game to a file and executing the game.
The function createOriginalSave()
should probably be broken up into createNewGame()
and then use the save()
function to save the new game.
The suggested createNewGame()
function should generate a map of rooms.
Each room should be responsible for printing it'sits data to the output file.
Most of the functions in the file that contain's main are toocontains complexmain
are too 'complex' and need to be broken up into smaller functions. You might find some reusable code this way. The code is currently very difficult to maintain and expand because it is so complex.