最近感冒了(〃>_<;〃),更新放慢为3天2更,可以吗
_| ̄|● ===》▇█▇▇▇█▇
>求关注,求点赞,求评论<
Thanks♪(・ω・)ノ
1A2B游戏规则介绍:(不看不知道,一看吓一跳)
你和对手分别选定一个四位数,各位数字不要重复。
游戏开始后,由双方分别猜对方所选定的四位数,猜测的结果将会列在自己的猜测历史列表,并以A和B来表示结果。
A代表猜测的数字中,数字相同且位置也正确的个数。
B代表猜测的数字中,数字相同但位置不一样的个数。
举例来说,如果对方的数字为1234,且你猜的数字为5283,其中2被猜到且位置正确,3也被猜到但位置不对,所以结果会出现1A1B。
比赛由先完整猜出对方数字的人获得胜利(也就是先得到4A的玩家)。
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <stdbool.h>
void InitializeGame(void);
void GetInput(char * input);
bool CheckAnswer(char * input);
bool GiveTips(char * input);
void GetRandom(char * random);
using namespace std;
char answer[5] = "";
char input[10] = "";
int times = 0;
int main(int argc, char** argv) {
char c;
while (true){
cout << "输入“S”开始游戏,“Q”退出游戏." << endl;
c = toupper(getchar());
while