Documentos de Académico
Documentos de Profesional
Documentos de Cultura
#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int const n=10;
void barcos (int [n][n]);
void tiro (int [n][n]);
void juego (int [n][n]);
void menu ();
void reglas ();
void tablero2 (char [n][n]);
void limpia2 (char [n][n]);
void limpia (int [n][n]);
void tablero (int a[n][n])
{
int x=0, y=0;
cout<<"1 2 3 4 5 6 7 8 9 10 \n";
for (x=0;x<n;x++)
{
cout<<"ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄij";
cout<<"\n";
for (y=0;y<n;y++)
{
cout<<a[x][y]<<" ";
}
cout<<"³"<<x+1<<"\n";
}
cout<<"ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n";
}
void main()
{
int m[n][n], o[n][n];
limpia (m);
menu ();
}
void menu ()
{
int m[n][n], o[n][n];
char op;
system ("CLS");
cout<<"\n MENU \n";
cout<<"\n a.- Instrucciones del juego \n";
cout<<"\n b.- Juego \n";
cout<<"\n c.- Abandonar el juego \n";
cout<<" \n Eliege una de las siguientes opciones:\n";
cin>>op;
switch (op)
{
case 'a':
reglas ();
break;
case 'b':
limpia (m);
barcos (o);
juego (o);
break;
case 'c':
cout<<" Gracias por jugar\n";
cout<<" Hasta pronto\n";
break;
}
}
void reglas ()
{
int t;
system ("CLS");
cout<<"\n REGLAS Y COMO JUGAR: \n";
cout<<"ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n";
}
void limpia2 (char a[n][n])
{
char i=0,j=0;
for (i=0;i<n;i++)
{
for(j=0;j<n;j++)
a[j][i]='°';
}
}