Guessing number game C++

closed account (ECGNwA7f)
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 !!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <iostream>
#include <string>
#include <stdio.h>
#include <ctime>

using namespace 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);
	}
closed account (ECGNwA7f)
I need something like this...

http://pastehtml.com/view/bmiy20hiy.html (only works in Firefox I think)

But in C++ and using "for" and "while" loops.
Topic archived. No new replies allowed.