2 dim array? project help

Have one Term describing category/theme you picked. This is the FACE term…
Menu:
Start Options
• New Game Option
• Exit Game Option
Level of Play – Use selects at start of game
4 x 4 grid (Easy)
6 x 6 grid (Moderate)
8 X 8 grid (Difficult)
Speed of Play – At start of game, User selects time interval for clicked-on term-pair to display
1 seconds (Difficult)
3 seconds (Moderate)
5 seconds (Easy)
Populate Grid with Term
At start of game – program places the same face/theme term in all squares in the visible grid
If 4 x 4 grid, randomly pick 8 terms, place each image name twice in 2-Dim array.
If 6 x 6 grid, randomly pick 18 terns, place each image name twice in 2-Dim array.
If 8 x 8 grid, randomly pick 32 terms, place each image name twice in 2-Dim array.
The 2-Dim Array corresponds to grid on screen.
During the course of play, the face/theme term in the grid is replaced by a
corresponding array terms, when user selects a grid square

Game Play
1) User selects a FIRST square, the theme/face term in the grid square is replace with correspond stored term, from the 2-dim array
2) User selects a SECOND square, the term theme/face in the second grid square is replace with the corresponding stored term, from the 2-dim array
3) The computer compares the terms for the two selected squares.
If they are the same, the terms remain on the screen and can no longer be selected.
If they are different, the term remain the screen for 1, 3 or 5 seconds, depending on user selection at the beginning of the game. After that elapse time, those two grid terms are replaced with the face/theme term.



I need help putting the values of my Musictypes array into the gameboard so people can chosse them

#include <iostream>
using namespace std;

int main() {


string startGame;
cout<< "New game"<<endl;
cout<<" Exit game"<<endl;
cin >>startGame;


if(startGame=="ExitGame"){
}

else if((startGame=="NewGame") ){

int size=0;
string Difficulty;

cout<< "Easy: 4x4"<<endl;
cout<< "Moderate 6x6"<<endl;
cout<< "Hard 8x8"<<endl;
cin>> Difficulty;



if (Difficulty== "Easy"){
size=4;
}


else if( Difficulty == "Moderate"){
size=6;}

else if( Difficulty=="Hard"){
size=8;

}

string MusicType[50]={"music","Rock","Hiphop","Punk","Folk","blues","country","RnB","pop","reggae","EDM","dupstep","metal","ska","jazz","disco","nosie","lofi","techno","trap","trance","opera","soul","DooWop","lounge","house","Hyphy","banda","hardcore","thrash","Crust","nortena","funk","crunk","gfunk","salsa","grunge","emo","samba","surf","mathcore","sludge","doom","screamo","rapcore","TripHop","BoomBap","Drill", "bitpop" ,"Grime"};

string answerboard [8] [8];
string Displayboard [8] [8];

for(int row=0; row<size; row++){


cout<<"-----------------------"<<endl;
for(int col=0; col<size; col++){
cout<< Displayboard[row][col]<<" | ";
}
cout<<endl;
}

for(int i=0; i<(size/size)/2; i++){

}
return 0;

}}

You forgot <string>.
That's all I can help with.

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
#include <iostream>
#include <string>
using namespace std;

int main() 
{
string startGame;
cout<< "New game"<<endl;
cout<<" Exit game"<<endl;
cin >>startGame;

if(startGame=="ExitGame")
{
cout << "GAME OVER" << endl;
return 0;
}

else if((startGame=="NewGame") )
{
int size=0;
string Difficulty;

cout<< "Easy: 4x4"<<endl;
cout<< "Moderate 6x6"<<endl;
cout<< "Hard 8x8"<<endl;
cin>> Difficulty;

if (Difficulty== "Easy")
{
size=4;
}

if( Difficulty == "Moderate")
{
size=6;
}

if( Difficulty=="Hard")
{
size=8;
}

string MusicType[50]={"music","Rock","Hiphop","Punk","Folk","blues","country","RnB","pop","reggae","EDM","dupstep","metal","ska","jazz","disco","nosie","lofi","techno","trap","trance","opera","soul","DooWop","lounge","house","Hyphy","banda","hardcore","thrash","Crust","nortena","funk","crunk","gfunk","salsa","grunge","emo","samba","surf","mathcore","sludge","doom","screamo","rapcore","TripHop","BoomBap","Drill", "bitpop" ,"Grime"};

string answerboard [8] [8];
string Displayboard [8] [8];

for(int row=0; row<size; row++)
{
cout <<"-----------------------"<<endl;
for(int col=0; col<size; col++)
{
cout<< Displayboard[row][col]<<" | ";
}
cout<<endl;
}

for(int i=0; i<(size/size)/2; i++)
{

}
return 0;

}
}
Last edited on
Topic archived. No new replies allowed.