I need to make a program. I need the number sets generated using loops. The user answer is either "yes" or "no" (indicating whether or not the secret number is in the set currently displayed).
This are the instructions I've been following. Display five sets of sixteen numbers each, one at a time and display the numbers in four rows and four columns to make it clear and easy for the player. Than I need to determine the player-selected number, For each set of sixteen numbers, randomly I will need to display its complement set instead of the set itself so the program must still be able to correctly determine the user-selected number. And give the option to the player if he wants to "play the game" again indefinitely or to terminate.
I believe when I have one loop... it will be copy and paste for the other ones? Sorry that I'm really new with this. I have started learning this like two weeks ago. That's why I need help from the experts !!
And this is my code, this is the fardest I got Please I need HELP !!
#include <iostream>
#include <string>
#include <stdio.h>
#include <ctime>
usingnamespace std;
int main()
{
cout << "Welcome to the Mind Reader game. I know what you're thinking." << "\n" << "Think of a number between and including 0 - 31, but don't tell me." << endl;
srand(time(0));
int r;
r = rand()%2;
int x;
x = 0;
int adding, enumber, onumber, number, FinalNum = 0;
cout << "Got it? Now tell me, is it in this group of 16 numbers? " << "\n""\n";
//--------------------------------------------------------------------------------------------------------------------------------
// Set 1, either all of the 00001s or all the 00000s
//--------------------------------------------------------------------------------------------------------------------------------
for(int i = 0; x < 32 ;i++)
{
if (x % 2 == 0){ //b1 = 0
x+=1;
cout << x << "\t";
if(i%4==3)
cout << endl;
x++;
}else {
if (x % 2 == 1){ //b1 = 1
x+=1;
cout << x << "\t";
if(i%4==3)
cout << endl;
x++;
}
}
}
cout << "\n""\n"<< "Select (1) Yes / (2) No: ";
int player;
cin >> player;
if(player == 1){
}if(player == 2){
}
system("pause");
return (0);
}