You could write to and read from a 'txt' file. You would need some trigger (a specific keystroke or a clicked button) for the user to initiate the saving process. The loading process could be automatic during your first world construction; but the file will need to be created before a transition from a strictly code created world to a world create via the file; or the loading process could be triggered by the user also (again, by a specific keystroke or click).
Now, you need to attempt to code something that will do what you require. Go one step at a time. If you have issues with a specific step, then post your attempted code, explain your issue in detail, and ask for help here.