hey guys, there is this program I tend to make but since I am a beginner I cant make it right.
it's the countries game, in with user should enter at most 20 countries, then the program should randomize them and give them to user to guess them.
there are some conditions for it.
1. by pressing 0 in the middle of the game, user should be shown the menu
2. by pressing 00 it should show the number of lives and score
3. uppercase and lowercase letters shouldn't be different
4. the menu should be like this:
1)start
2)enter the name list
3)check the name list
4)delete the name list
and I have trouble with adding sound and stuff.
I would appreciate your help in this project. thanks a lot.
I suggest use to use c string library to deal with words without matter if they are upper case or lower case. And use standard input and output to handle interface. You can use random numbers found in cstdio library. Rewrite question on internet taking into account this, and let us know what you have done.
#include<iostream>
#include<string>
#include<cmath>
#include<time.h>
#include<stdlib.h>
using namespace std;
int main()
{
int n;
cout<<"enter the number of countries:\n";
cin>>n;
while(n<3||n>20)
{
cout<<"please get a number between 2 and 21.\n";
cin>>n;
}
string country;
string count[20];
for (int i=0 ; i<n; i++){
cout<<"please enter the name of countries:\n";
cin>>country;
count[i]=country;
}
int numberOflives;
numberOflives= floor(n/3);
int points=0;
srand(time(0));
int x=rand()%n;
int s=count[x].size();
string words[20];
for(int j=0; j<s; j++)
{
cout<<"-";
words[j]="-";