当前位置:网站首页>C language guessing numbers game

C language guessing numbers game

2022-06-09 01:38:00 _ Programming_

C Language Guessing Number Game

Title Two guessing numbers game
1. The design requirements :
The game can be randomly generated by the program - individual N Digit number , Or by the
The user enters a N Digit number , As a number to be guessed ( Ladies and gentlemen
Don't repeat ). After the player begins to guess , There can be M Secondary machine
Will enter a number to match the above number to be guessed . Every time the user enters a
Time , The system gives the guess result :A Indicates that the position is correct and the number
correct ,B Indicates that the number is correct and the position is incorrect . such as : 2A1B,
Express 2 The bit position is correct and the number is correct ,1 The digit number is correct but the position
Incorrect .
After a guess , Game over . if M I'll run out of opportunities , game
It's over . The menu format is shown in the figure .
2. Basic function
1) Generate data to be guessed , Random generation , Or entered by the user .
Need to judge legitimacy : N Digit numbers do not appear repeatedly .
2) Provide the most M One chance to guess , Each feedback guess result . become
The function immediately ends guessing and returns to the main menu .
3) Enter the user name before the game starts , First use for user notes
book . Whether the game is successful or not can return to the main menu .
4) View results : View the historical guess results of a user
Minimum number of guesses , The success rate ;
5) Parameters M,N You can set it up freely

Source download

link :https://pan.baidu.com/s/1JJs9vbZahUCB6cQvXLgAVg?pwd=1111
Extraction code :1111

原网站

版权声明
本文为[_ Programming_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090132387641.html