I'm in the process of writing a text based RPG as a sort of.. coding challenge to myself. I'm trying to give the player the choice to enter his/her name but as soon as one enters his/her name, the entire program is sent into some infinite loop!
I'll put the code down here (either side of the name)!
Definitely DO NOT use goto anywhere, at all. Once your game becomes large, the gotos will become extremely confusing and start messing everything up. If I were doing a text based RPG, I would do this (note that these lists will not be exhaustive):
Declare a class which is the main character.
Declare a class for items.
Declare a base class for monsters.
Use inheritance from the base class monster to make all the monsters.
Then I would have functions for various things, such as:
Use item
Fight monster
Movement
View inventory
Maze generation (if you're using a maze).
Then in the main function, first of all call a function to set up the basic stats of the character. After this, give the user the options of movement, fighting (if applicable), viewing inventory etc and call the appropriate functions.
Writing an RPG game is actually quite involved and before you start, make sure you are very familiar with classes, inheritance, functions and various applicable aspects of mathematics.