Proyecto Programacion

Páginas: 5 (1140 palabras) Publicado: 25 de octubre de 2015
#include
#include

using namespace std;

#include

#include

const int tamano = 50;
char jugador1[tamano];
char jugador2[tamano];

char jugadorActual;
char tablero[11][11];
int puntuacionX = 0;
int puntuacionO = 0;

void inicializar(){
for(int i = 0; i < 11; i++){
for(int j = 0 ; j < 11; j++){
tablero[i][j] = '*';
}
}
}void fase1(){
for(int i = 4; i < 7; i++){
for(int j = 4 ; j < 7; j++){
tablero[i][j] = '_';
}
}
}

void fase2(){
for (int i = 2; i < 9; i++){
for(int j = 2 ; j < 9; j++){
if (tablero [i][j] == '*')
tablero[i][j] = '_';
}
}
}

void fase3(){
for (int i = 0; i < 11; i++){
for(int j = 0 ; j < 11;j++){
if (tablero [i][j] == '*')
tablero[i][j] = '_';
}
}
}

void desplegarTablero(){
for(int i = 0 ; i < 11 ; i ++){
for(int j = 0 ; j < 11; j++){
if(tablero[i][j]== 'J') { printf("%s\ ","JX" );}
else if(tablero[i][j]== 'Z'){ printf("%s\ ","JO" );}
else {printf("%c\ ", tablero[i][j]);}
}printf("\n");
printf("\n");
}
}

int verificaHorizontalX(void){
for (int i = 0; i < 11; i++){
for(int j = 0 ; j < 11; j++){
if (tablero [i][j] == 'X'){
if ((tablero [i][j] == 'X') && (tablero[i][j+1] == 'X') && (tablero[i][j+2] == 'X')){
(tablero[i][j] = 'J') && (tablero[i][j+1] = 'J') && (tablero[i][j+2] = 'J');puntuacionX++;
}
}
}
}
}

int verificaHorizontalO(void){
for (int i = 0; i < 11; i++){
for(int j = 0 ; j < 11; j++){
if ((tablero [i][j] == 'O') && (tablero[i][j+1] == 'O') && (tablero[i][j+2] == 'O')){
(tablero[i][j] = 'Z') && (tablero[i][j+1] = 'Z') && (tablero[i][j+2] = 'Z');puntuacionO++;
}
}
}
}

int verificaVerticalX(void){
for (int i = 0; i < 11; i++){
for(int j = 0 ; j < 11; j++){
if (tablero [i][j] == 'X'){
if ((tablero [i][j] == 'X') && (tablero[i+1][j] == 'X') && (tablero[i+2][j] == 'X')){
(tablero[i][j] = 'J') && (tablero[i+1][j] = 'J') && (tablero[i+2][j]= 'J');
puntuacionX++;
}
}
}
}
}

int verificaVerticalO(void){
for (int i = 0; i < 11; i++){
for(int j = 0 ; j < 11; j++){
if (tablero [i][j] == 'O'){
if ((tablero [i][j] == 'O') && (tablero[i+1][j] == 'O') && (tablero[i+2][j] == 'O')){
(tablero[i][j] = 'Z') &&(tablero[i+1][j] = 'Z') && (tablero[i+2][j] = 'Z');
puntuacionO++;
}
}
}
}
}

int verificaDiagonalAscX(void){
for (int i = 0; i < 11; i++){
for(int j = 0 ; j < 11; j++){
if (tablero [i][j] == 'X'){
if ((tablero [i][j] == 'X') && (tablero[i-1][j+1] == 'X') && (tablero[i-2][j+2] == 'X')){(tablero[i][j] = 'J') && (tablero[i-1][j+1] = 'J') && (tablero[i-2][j+2] = 'J');
puntuacionX++;
}
}
}
}
}

int verificaDiagonalAscO(void){
for (int i = 0; i < 11; i++){
for(int j = 0 ; j < 11; j++){
if (tablero [i][j] == 'O'){
if ((tablero [i][j] == 'O') && (tablero[i-1][j+1] == 'O') &&(tablero[i-2][j+2] == 'O')){
(tablero[i][j] = 'Z') && (tablero[i-1][j+1] = 'Z') && (tablero[i-2][j+2] = 'Z');
puntuacionO++;
}
}
}
}
}

int verificaDiagonalDescX(void){
for (int i = 0; i < 11; i++){
for(int j = 0 ; j < 11; j++){
if (tablero [i][j] == 'X'){
if ((tablero...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • programacion de proyectos
  • Programacion proyecto
  • Programacion De Proyectos
  • Proyecto Programacion
  • Proyecto de programacion
  • PROYECTO DE PROGRAMACION
  • Proyecto programacion
  • Proyecto de programación.

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS