Simple modularization exercise. Have your character ask the user how many steps to take. The character walks one step, the number of times entered. If on edge, bounce so the character doesn't walk off the screen!