Totito en c++

Páginas: 4 (987 palabras) Publicado: 24 de febrero de 2012
Universidad Mariano Gálvez

Facultad de Ingeniería en Sistemas

Programacion

“Codigo Totito”

Juan José Turcios Samayoa.

Carné: 2490-05-7795

19 de febrero de 2011, Salamá BajaVerapaz.
CODIGO TOTITO

#include <conio.h>
#include <iostream.h>
#include <stdio.h>
#include <string.h>

char a=' ', b=' ', c=' ', d=' ', e=' ', f=' ', g=' ', h=' ', i=' ',temp;

void resultado()
{
gotoxy(44,19); cout<<a;
gotoxy(49,19); cout<<b;
gotoxy(55,19); cout<<c;
gotoxy(44,23); cout<<d;
gotoxy(49,23); cout<<e;gotoxy(55,23); cout<<f;
gotoxy(44,27); cout<<g;
gotoxy(49,27); cout<<h;
gotoxy(55,27); cout<<i;
}

int validacion(char op){
if(a==op && b==op&& c==op) return 1;
if(d==op && e==op && f==op) return 1;
if(g==op && h==op && i==op) return 1;
if(a==op && d==op && g==op)return 1;
if(b==op && e==op && h==op) return 1;
if(c==op && f==op && i==op) return 1;
if(a==op && e==op && i==op) return 1;if(g==op && e==op && c==op) return 1;
return 0;
}

int init()
{

cout << "\n\n(Jugador 1) Seleccione posicion: ";
cin>>temp;

if(temp=='a'){
a = 'X';}
if(temp=='b'){
b = 'X';
}
if(temp=='c'){
c = 'X';
}
if(temp=='d'){
d = 'X';
}
if(temp=='e'){
e = 'X';
}
if(temp=='f'){
f ='X';
}
if(temp=='g'){
g = 'X';
}
if(temp=='h'){
h = 'X';
}
if(temp=='i'){
i = 'X';
}
resultado();

cout << "\n\n(Jugador 2) Seleccioneposicion: ";
cin>>temp;

if(temp=='a'){
a = '0';
}
if(temp=='b'){
b = '0';
}
if(temp=='c'){
c = '0';
}
if(temp=='d'){
d = '0';
}...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Totito
  • Totito
  • Estrategias de totito
  • TOTITO
  • Totita
  • Fckc c c c c
  • ahncc c c c
  • ´ç´-ç´-ç´-

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS