This is a C++ program that runs a game for the user. In this game the user must guess a code generated by the computer. The user will have X chances to guess the code, with the value of X being chosen at the beginning of the game. For every guess they will be told how many digits are correct but misplaced and how many digits are completely correct. The program runs as follows:
Step 1: Print out the game’s instructions
Step 2: Get the length of the code, range of numbers, and number of guesses
Step 3: Generate the code to the user’s specifications using a random number generator
Step 4: Print the scoreboard and begin the core gameplay loop
Step 5: Get the user’s guess, ensure that it is within the specified range, and score it. Repeat until the user guesses the code or runs out of guesses.
Step 6: Print the winning or losing message and ask the user if they wish to play again. If yes, go to step 2. If not, exit the program.