Advertisement
Guest User

JuegoTate

a guest
Sep 19th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class JuegoTaTeTi {
  3.  
  4.     public static void main(String[] args) {
  5.        
  6.         TaTeTi tate  = new TaTeTi();       
  7.         Scanner scan = new Scanner(System.in);
  8.         int fila;
  9.         int col;
  10.         boolean seguir = true;
  11.         while(seguir)
  12.         {
  13.             try {
  14.                 tate.mostrar();
  15.                 while(!tate.terminado()){
  16.                     System.out.println(" Juega --> "+tate.getTurno());
  17.                     System.out.println(" Ingrese una fila ");
  18.                     fila = scan.nextInt();
  19.                     System.out.println("Ingrese una columna ");
  20.                     col = scan.nextInt();
  21.                     tate.jugar(fila, col);
  22.                     tate.mostrar();    
  23.                 }
  24.                
  25.                 if(tate.ganador() == ' ')
  26.                     System.out.println("Se produjo un empate!!!!!");
  27.                 else
  28.                     System.out.println("El ganador es el jugador: "+ tate.ganador()+"   felicitaciones!!!");
  29.                
  30.                 scan.close();
  31.                 seguir = false;
  32.             } catch (Exception e) {
  33.                 System.out.println(e.getMessage());
  34.             }
  35.            
  36.    
  37.         }
  38.         }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement