I made a simple color finding game. the problem is that my color input guess is not good so complex I want them in one line and also I want to see my tries at certain places. can you help me
thanks in advance.
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cctype>
#include <conio.h>
using namespace std;
int main(int argc, char *argv[])
{
int j;
int trial=0;
int counters=0;
int color_correct=0;
string guess[4];
vector <string> colors;
colors.push_back("yellow");
colors.push_back("blue");
colors.push_back("black");
colors.push_back("white");
colors.push_back("red");
colors.push_back("green");
srand(time(0));
random_shuffle(colors.begin(),colors.end());
cout << "\t \t \t Find the colors in order.\n\n ";
cout << "\n there are six available colors which are yellow,red,green,black,blue,white \n";
cout << "\n pls select 4 and find their places\n \n ";
while (counters != 4 )
{ counters=0;
color_correct=0;
for ( int j=0;j<4;j++)
{
cout << "\n"<<j+1<<". color=\n\n";
cin >> guess[j];
cout <<"\n";
}
for (int j=0;j<4;j++)
for (int i=0;i<4;i++)
if (colors[j] == guess[i])
color_correct=color_correct+1;
for ( int j=0;j<4;j++)
{
if (colors[j] == guess[j])
counters=counters+1;
}
trial++;
cout << trial<<".try ";
for ( int j=0;j<4;j++)
{
cout << guess[j]<<"\t";
}
cout << " \n \n you know "<< color_correct<< " colors \n";
cout << " you know "<< counters<< " colors in order\n";
}
cout <<" you guessed all correct.";
getch();
}