menu de jogo do tetris C++

Queiros

Power Member
boas pessoal... eu tenho o seguinte menu para o jogo do tetris e na parte da escolha do nivel eu meto o nivel e aquilo continua a pedir o nivel. o que eu queria era escolher o nivel e voltar ao menu principal, se o nivel for invalido gostaria que continuasse a pedir até ser um correcto.. desde ja agradeço qualquer ajuda

Código:
 #include<iostream>
usingnamespace std;
void menu();
int opcaomenu( char op );
int niveldificuldade(int nivel);
 
int main() {
char op;
int x = 0;

do {
menu(); 

cin >> op;
op = toupper(op);
x = opcaomenu( op );
} while( x == 0 );
}
void menu( void ) {
cout << "**************************************************" << endl;
cout << "*********TETRIS*******TETRIS*******TETRIS*********" << endl;
cout << "**************************************************" << endl << endl <<endl;
cout << "Menu:" << endl;
cout << "J - Jogar." << endl;
cout << "N - Nível de dificuldade do jogo." << endl;
cout << "P - Pontuacao." << endl << endl;
cout << "S - Sair do jogo." << endl;
}
int opcaomenu( char op ) {
char sair;
int nd = 1, retorno = 0;
switch(op) {
case'J': {
break;
}
case'N': {
nd = niveldificuldade( nd );
system("cls");
cout << "Opcão selecionada: " << nd << endl;
break;
}
case'P': {
break;
}
case'S': {
do {
cout << "Deseja sair do jogo? (s/n)" << endl;
cin >> sair;
sair=toupper(sair);
if( sair == 'S' ) {
retorno = 1;
}
elseif( sair == 'N' ) {
retorno = 0;
}
else {
cout << "Opção não reconhecida." << endl;
}
} while(sair!='S' && sair !='N');
break;
}
default: {
cout << "Opção invalida." << endl;
}
}
return retorno;
}
int niveldificuldade(int nivel) {

system ( "cls" );
 
do{
cout << "Escolha um nível de dificuldade:" << endl;
cout << " 1" << endl;
cout << " 2" << endl;
cout << " 3" << endl;
cout << " 4" << endl;

cin >> nivel;
if ((nivel < 1) || (nivel > 4)) {
cout << "Nível inválido!" << endl;
}
}while ((nivel !='1') && (nivel !='2') && (nivel!='3') && (nivel!='4')) ;
return nivel;
}

sei que o problema esta no ciclo de repetição mas nao consigo ver onde..
 
Última edição pelo moderador:
Boas,
}while ((nivel !='1') && (nivel !='2') && (nivel!='3') && (nivel!='4')) ;
Estás a dizer que ele deve fazer enquanto for diferente de 1 e diferente de 2 e de 3 e de 4, ora como só metes uma opção será sempre diferente de 3 das outras... pensa lá noutra maneira, olha bem para o teu if ;)
cumpzz
 
Basta isto:

Código:
[SIZE=2][COLOR=White]do{
cout << [/COLOR][/SIZE][SIZE=2][COLOR=White]"Escolha um nível de dificuldade:"[/COLOR][/SIZE][SIZE=2][COLOR=White] << endl;
cout << [/COLOR][/SIZE][SIZE=2][COLOR=White]" 1"[/COLOR][/SIZE][SIZE=2][COLOR=White] << endl;
cout << [/COLOR][/SIZE][SIZE=2][COLOR=White]" 2"[/COLOR][/SIZE][SIZE=2][COLOR=White] << endl;
cout << [/COLOR][/SIZE][SIZE=2][COLOR=White]" 3"[/COLOR][/SIZE][SIZE=2][COLOR=White] << endl;
cout << [/COLOR][/SIZE][SIZE=2][COLOR=White]" 4"[/COLOR][/SIZE][SIZE=2][COLOR=White] << endl;

cin >> nivel;
[/COLOR][/SIZE][SIZE=2][COLOR=White]if[/COLOR][/SIZE][COLOR=White][SIZE=2] ((nivel < 1) || (nivel > 4)) {
cout << [/SIZE][SIZE=2]"Nível inválido!"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR][SIZE=2]
}[/SIZE]
[SIZE=2][COLOR=White] [SIZE=2]}while[/SIZE][SIZE=2] ([/SIZE][SIZE=2]nivel<1 || nivel>4) ;[/SIZE][/COLOR][/SIZE]


Não precisas daquilo tudo. Basta entrar no ciclo pelo menos uma vez (através de "do...while") e pedes o nível e depois o user insere. Se for menor que 1 ou maior que 4, ele volta de novo a entrar no ciclo.
 
Última edição:


Não precisas daquilo tudo. Basta entrar no ciclo pelo menos uma vez (através de "do...while") e pedes o nível e depois o user insere. Se for menor que 1 ou maior que 4, ele volta de novo a entrar no ciclo.

Mas assim não dá o "nível inválido", podia era deixar o if e meter um else tipo end=1, e no while fazia while (!end), em termos de eficiência não sei se será mau...
cumpzz
 
mas então,
sem isto:

if ((nivel < 1) || (nivel > 4)) {
cout << "Nível inválido!" << endl;
}

ele não dá o erro, e se não tiver o if vai estar a dar nível inválido mesmo se for válido...
cumpzz
 
isto de estudar PIC's, filme e fazer posts ao mesmo tempo tem que se lhe diga :D :P
Mas então será melhor da maneira com o a será mais eficiente penso eu...
cumpzz
 
pq não fazes assim a função: o último return não está lá a fazer nada :D é só para o compilador não melgar ;)

nesse return tb podes user o break; penso q ele sai para fora do while . Não compilei por isso não sei se há erros, mas penso q não

Código:
int niveldificuldade(int nivel) {

system ( "cls" );
 
while(1)
{
  cout << "Escolha um nível de dificuldade:" << endl;  
  cout << " 1" << endl;
  cout << " 2" << endl;
  cout << " 3" << endl;
  cout << " 4" << endl;

  cin >> nivel;
  if ((nivel < 1) || (nivel > 4)) 
    cout << "Nível inválido!" << endl;
  else
    return nivel;
 }
return nivel;
}
 
Última edição pelo moderador:
pq não fazes assim a função: o último return não está lá a fazer nada :D é só para o compilador não melgar ;)

nesse return tb podes user o break; penso q ele sai para fora do while . Não compilei por isso não sei se há erros, mas penso q não

Código:
int niveldificuldade(int nivel) {
 
system ( "cls" );
 
while(1)
{
  cout << "Escolha um nível de dificuldade:" << endl;  
  cout << " 1" << endl;
  cout << " 2" << endl;
  cout << " 3" << endl;
  cout << " 4" << endl;
 
  cin >> nivel;
  if ((nivel < 1) || (nivel > 4)) 
    cout << "Nível inválido!" << endl;
  else
    return nivel;
 }
return nivel;
}
perfeito, ja esta a funcionar. eu comecei com c++ este ano entao ainda tenho falhas nalgumas coisas.. agora vou tentar fazer o tabuleiro do jogo.. uma matriz estou para ver o que vai sair..
 
Epah samouco não me leves a mal, mas assim eles ficam mal habituados... se não consegue trabalhar com ciclos e condições o que fará depois quando a matéria avançar? já para não falar que nunca terá o treino mental de resolução de problemas complicados por ele mesmo... mas é só uma opinião ;)
cumpzz
 
Epah samouco não me leves a mal, mas assim eles ficam mal habituados... se não consegue trabalhar com ciclos e condições o que fará depois quando a matéria avançar? já para não falar que nunca terá o treino mental de resolução de problemas complicados por ele mesmo... mas é só uma opinião ;)
cumpzz
eu ja tinha conseguido quando disseste para olhar para o if, percebi logo que era igual no while.. so coloquei a quote dele para mostrar que era assim que tinha feito... ja agora podiam so ajudar-me a inserir a matriz na parte do "jogar" no menu principal? aqui esta o codigo que fiz ate agora:

Código:
[COLOR=lemonchiffon][SIZE=2]#include[/SIZE][SIZE=2]<iostream>[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]using[/SIZE][SIZE=2]namespace[/SIZE][SIZE=2] std;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] menu();[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] opcaomenu( [/SIZE][SIZE=2]char[/SIZE][SIZE=2] op );[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] niveldificuldade([/SIZE][SIZE=2]int[/SIZE][SIZE=2] nivel);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] matriz();[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] main() {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]char[/SIZE][SIZE=2] op;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] x = 0;[/SIZE][/COLOR]
 
[COLOR=lemonchiffon][SIZE=2]do[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]menu(); [/COLOR][/SIZE]
 
[SIZE=2][COLOR=lemonchiffon]cin >> op;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]op = toupper(op);[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]x = opcaomenu( op );[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]} [/SIZE][SIZE=2]while[/SIZE][SIZE=2]( x == 0 );[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] menu( [/SIZE][SIZE=2]void[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"**************************************************"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"*********TETRIS*******TETRIS*******TETRIS*********"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"**************************************************"[/SIZE][SIZE=2] << endl << endl <<endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Menu:"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"J - Jogar."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"N - Nível de dificuldade do jogo."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"P - Pontuacao."[/SIZE][SIZE=2] << endl << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"S - Sair do jogo."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] opcaomenu( [/SIZE][SIZE=2]char[/SIZE][SIZE=2] op ) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]char[/SIZE][SIZE=2] sair;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] nd = 1, retorno = 0;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]switch[/SIZE][SIZE=2](op) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'J'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] matriz ( [/SIZE][SIZE=2]void[/SIZE][SIZE=2] );[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'N'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]nd = niveldificuldade( nd );[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]system([/SIZE][SIZE=2]"cls"[/SIZE][SIZE=2]);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Opcão selecionada: "[/SIZE][SIZE=2] << nd << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'P'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'S'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]do[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Deseja sair do jogo? (s/n)"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]cin >> sair;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]sair=toupper(sair);[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]if[/SIZE][SIZE=2]( sair == [/SIZE][SIZE=2]'S'[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]retorno = 1;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]else[/SIZE][SIZE=2]if[/SIZE][SIZE=2]( sair == [/SIZE][SIZE=2]'N'[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]retorno = 0;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]else[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"opcao invalida"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]} [/SIZE][SIZE=2]while[/SIZE][SIZE=2](sair!=[/SIZE][SIZE=2]'S'[/SIZE][SIZE=2] && sair !=[/SIZE][SIZE=2]'N'[/SIZE][SIZE=2]);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]default[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Opção invalida."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] retorno;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] niveldificuldade([/SIZE][SIZE=2]int[/SIZE][SIZE=2] nivel) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]system ( [/SIZE][SIZE=2]"cls"[/SIZE][SIZE=2] );[/SIZE][/COLOR]
 
[COLOR=lemonchiffon][SIZE=2]while[/SIZE][SIZE=2](1)[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]{[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Escolha um nível de dificuldade:"[/SIZE][SIZE=2] << endl; [/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 1"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 2"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 3"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 4"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]cin >> nivel;[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]if[/SIZE][SIZE=2] ((nivel < 1) || (nivel > 4)) [/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Nível inválido!"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]else[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] nivel;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] nivel;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] matriz([/SIZE][SIZE=2]int[/SIZE][SIZE=2] colunas, [/SIZE][SIZE=2]int[/SIZE][SIZE=2] linhas) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] i,j;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] jogo [30][15];[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]for[/SIZE][SIZE=2] (i=0; (i < linhas) ;i++){[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]for[/SIZE][SIZE=2](j=0; (j < colunas) ;j++) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]jogo [i][j]=0;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]cout << jogo[i][j] << endl;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon]
[/COLOR]
 
eu ja tinha conseguido quando disseste para olhar para o if, percebi logo que era igual no while.. so coloquei a quote dele para mostrar que era assim que tinha feito... ja agora podiam so ajudar-me a inserir a matriz na parte do "jogar" no menu principal? aqui esta o codigo que fiz ate agora:

Código:
[COLOR=lemonchiffon][SIZE=2]#include[/SIZE][SIZE=2]<iostream>[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]using[/SIZE][SIZE=2]namespace[/SIZE][SIZE=2] std;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] menu();[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] opcaomenu( [/SIZE][SIZE=2]char[/SIZE][SIZE=2] op );[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] niveldificuldade([/SIZE][SIZE=2]int[/SIZE][SIZE=2] nivel);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] matriz();[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] main() {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]char[/SIZE][SIZE=2] op;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] x = 0;[/SIZE][/COLOR]
 
[COLOR=lemonchiffon][SIZE=2]do[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]menu(); [/COLOR][/SIZE]
 
[SIZE=2][COLOR=lemonchiffon]cin >> op;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]op = toupper(op);[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]x = opcaomenu( op );[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]} [/SIZE][SIZE=2]while[/SIZE][SIZE=2]( x == 0 );[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] menu( [/SIZE][SIZE=2]void[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"**************************************************"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"*********TETRIS*******TETRIS*******TETRIS*********"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"**************************************************"[/SIZE][SIZE=2] << endl << endl <<endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Menu:"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"J - Jogar."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"N - Nível de dificuldade do jogo."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"P - Pontuacao."[/SIZE][SIZE=2] << endl << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"S - Sair do jogo."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] opcaomenu( [/SIZE][SIZE=2]char[/SIZE][SIZE=2] op ) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]char[/SIZE][SIZE=2] sair;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] nd = 1, retorno = 0;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]switch[/SIZE][SIZE=2](op) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'J'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] matriz ( [/SIZE][SIZE=2]void[/SIZE][SIZE=2] );[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'N'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]nd = niveldificuldade( nd );[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]system([/SIZE][SIZE=2]"cls"[/SIZE][SIZE=2]);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Opcão selecionada: "[/SIZE][SIZE=2] << nd << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'P'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'S'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]do[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Deseja sair do jogo? (s/n)"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]cin >> sair;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]sair=toupper(sair);[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]if[/SIZE][SIZE=2]( sair == [/SIZE][SIZE=2]'S'[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]retorno = 1;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]else[/SIZE][SIZE=2]if[/SIZE][SIZE=2]( sair == [/SIZE][SIZE=2]'N'[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]retorno = 0;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]else[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"opcao invalida"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]} [/SIZE][SIZE=2]while[/SIZE][SIZE=2](sair!=[/SIZE][SIZE=2]'S'[/SIZE][SIZE=2] && sair !=[/SIZE][SIZE=2]'N'[/SIZE][SIZE=2]);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]default[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Opção invalida."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] retorno;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] niveldificuldade([/SIZE][SIZE=2]int[/SIZE][SIZE=2] nivel) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]system ( [/SIZE][SIZE=2]"cls"[/SIZE][SIZE=2] );[/SIZE][/COLOR]
 
[COLOR=lemonchiffon][SIZE=2]while[/SIZE][SIZE=2](1)[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]{[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Escolha um nível de dificuldade:"[/SIZE][SIZE=2] << endl; [/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 1"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 2"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 3"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 4"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]cin >> nivel;[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]if[/SIZE][SIZE=2] ((nivel < 1) || (nivel > 4)) [/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Nível inválido!"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]else[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] nivel;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] nivel;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] matriz([/SIZE][SIZE=2]int[/SIZE][SIZE=2] colunas, [/SIZE][SIZE=2]int[/SIZE][SIZE=2] linhas) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] i,j;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] jogo [30][15];[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]for[/SIZE][SIZE=2] (i=0; (i < linhas) ;i++){[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]for[/SIZE][SIZE=2](j=0; (j < colunas) ;j++) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]jogo [i][j]=0;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]cout << jogo[i][j] << endl;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]

Inserir a matriz como? Podias ser mais específico?

Já agora, podias por uns espaços no teu código, uns comentários, torna-se mais fácil para quem te quer ajudar.

Vá, cumps
 
Código:
[COLOR=lemonchiffon][SIZE=2]#include[/SIZE][SIZE=2]<iostream>[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]using[/SIZE][SIZE=2]namespace[/SIZE][SIZE=2] std;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] menu();[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] opcaomenu( [/SIZE][SIZE=2]char[/SIZE][SIZE=2] op );[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] niveldificuldade([/SIZE][SIZE=2]int[/SIZE][SIZE=2] nivel);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] matriz();[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] main() {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]char[/SIZE][SIZE=2] op;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] x = 0;[/SIZE][/COLOR]
 
[COLOR=lemonchiffon][SIZE=2]do[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]menu(); [/COLOR][/SIZE]
 
[SIZE=2][COLOR=lemonchiffon]cin >> op;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]op = toupper(op);[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]x = opcaomenu( op );[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]} [/SIZE][SIZE=2]while[/SIZE][SIZE=2]( x == 0 );[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] menu( [/SIZE][SIZE=2]void[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"**************************************************"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"*********TETRIS*******TETRIS*******TETRIS*********"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"**************************************************"[/SIZE][SIZE=2] << endl << endl <<endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Menu:"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"J - Jogar."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"N - Nível de dificuldade do jogo."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"P - Pontuacao."[/SIZE][SIZE=2] << endl << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"S - Sair do jogo."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] opcaomenu( [/SIZE][SIZE=2]char[/SIZE][SIZE=2] op ) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]char[/SIZE][SIZE=2] sair;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] nd = 1, retorno = 0;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]switch[/SIZE][SIZE=2](op) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'J'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[SIZE=2]void[/SIZE][SIZE=2] matriz ( [/SIZE][SIZE=2]void[/SIZE][SIZE=2] ); [COLOR=red]matriz tem 2 argumentos: int colunas, int linhas!! não é void![/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'N'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]nd = niveldificuldade( nd );[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]system([/SIZE][SIZE=2]"cls"[/SIZE][SIZE=2]);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Opcão selecionada: "[/SIZE][SIZE=2] << nd << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'P'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]case[/SIZE][SIZE=2]'S'[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]do[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Deseja sair do jogo? (s/n)"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]cin >> sair;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]sair=toupper(sair);[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]if[/SIZE][SIZE=2]( sair == [/SIZE][SIZE=2]'S'[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]retorno = 1;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]else[/SIZE][SIZE=2]if[/SIZE][SIZE=2]( sair == [/SIZE][SIZE=2]'N'[/SIZE][SIZE=2] ) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]retorno = 0;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]else[/SIZE][SIZE=2] {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"opcao invalida"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]} [/SIZE][SIZE=2]while[/SIZE][SIZE=2](sair!=[/SIZE][SIZE=2]'S'[/SIZE][SIZE=2] && sair !=[/SIZE][SIZE=2]'N'[/SIZE][SIZE=2]);[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]break[/SIZE][SIZE=2];[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]default[/SIZE][SIZE=2]: {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Opção invalida."[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] retorno;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] niveldificuldade([/SIZE][SIZE=2]int[/SIZE][SIZE=2] nivel) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]system ( [/SIZE][SIZE=2]"cls"[/SIZE][SIZE=2] );[/SIZE][/COLOR]
 
[COLOR=lemonchiffon][SIZE=2]while[/SIZE][SIZE=2](1)[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]{[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Escolha um nível de dificuldade:"[/SIZE][SIZE=2] << endl; [/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 1"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 2"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 3"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]" 4"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]cin >> nivel;[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]if[/SIZE][SIZE=2] ((nivel < 1) || (nivel > 4)) [/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]cout << [/SIZE][SIZE=2]"Nível inválido!"[/SIZE][SIZE=2] << endl;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]else[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] nivel;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]return[/SIZE][SIZE=2] nivel;[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[COLOR=lemonchiffon][SIZE=2]void[/SIZE][SIZE=2] matriz([/SIZE][SIZE=2]int[/SIZE][SIZE=2] colunas, [/SIZE][SIZE=2]int[/SIZE][SIZE=2] linhas) {[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] i,j;[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]int[/SIZE][SIZE=2] jogo [30][15];[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]for[/SIZE][SIZE=2] (i=0; (i < linhas) ;i++){[/SIZE][/COLOR]
[COLOR=lemonchiffon][SIZE=2]for[/SIZE][SIZE=2](j=0; (j < colunas) ;j++) {[/SIZE][/COLOR]
[SIZE=2][COLOR=lemonchiffon]jogo [i][j]=0;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]cout << jogo[i][j] << endl;[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]
[SIZE=2][COLOR=lemonchiffon]}[/COLOR][/SIZE]

Estás a passar mal os parâmetros da matriz quando invocas a função matriz. Vê o comentário que deixei no código.
 
Estás a passar mal os parâmetros da matriz quando invocas a função matriz. Vê o comentário que deixei no código.
podias dar-me so uma ajudinha do que fazer? a matriz da maneira que esta aparece no ecrã?

*o que eu queria era chamar a função da matriz para a opção "Jogar" do menu principal para que aparecesse o tabuleiro de jogo quando se escolhe a opção "Jogar"

obrigado a todos

cumpz
 
a matriz da maneira que esta aparece no ecrã?

Sei lá, nem sequer testei o código, mas detectei logo o erro nos parâmetros quando invocas a função matriz:

Código:
[COLOR=red]
switch(op) {
    case 'J': void matriz(void);
          break;[/COLOR]
O erro está nos parâmetros da função matriz. Vai à tua definição da função para ver se coincidem. Vais ver que não...
 
Back
Topo