Quick actions

cmd+k|ctrl+k

Navigation

Languages

Dado'sGame

Snippet info

Language

Csharp

Visibility

public

Author

joluzel19

Created

2016-08-19T05:20:07Z

Updated

2016-08-19T05:20:18Z

using System;

class MainClass
{
    static void Main()
    {

        Dado clsDado = new Dado();
        Jugador clsJugador = new Jugador();
        Juego clsJuego = new Juego();
        Random r = new Random();
        int puntajePrimerJugador;
        int puntajeSegundoJugador;
        int puntajeTercerJugador;

        //INICIANDO JUEGO
        if (clsJuego.IniciarJuego())
        {
            Console.WriteLine("Iniciar Juego\n");
            Console.WriteLine("Seleciona una opcion:Si No\n");
            Console.WriteLine("Si\n");

            Console.WriteLine("Cargando Juego. Por favor espere");
            Console.Write("----------------------------------------------------------------------------------------------------\n");
            Console.WriteLine("BIENVENIDOS A DADO'S GAME!!! :)\n");
            Console.WriteLine("Ingrese el numero de jugadores: 3\n");
            clsJugador.CantidadJugadores = 3;
           

            Console.WriteLine("Ingrese el alias de los jugadores: ");
           
            //ASIGNAMOS LA LISTA DE JUGADORES
            string[] jugadores = { "Karina", "Angel", "Luis" };
            clsJugador.ListaJugadores(jugadores); //SE IMPRIMEN LOS JUGADORE
            
            do{

                    int SeleccionPrimerJugador = r.Next(1,7);
                    int SeleccionSegundoJugador = r.Next(1,7);
                    int SeleccionTercerJugador = r.Next(1,7);

                    Console.WriteLine("Ronda " +clsDado.Rondas);
                    Console.WriteLine("Karina elige un numero del dado: " + SeleccionPrimerJugador);
                    Console.WriteLine("Angel elige un numero del dado: " + SeleccionSegundoJugador);
                    Console.WriteLine("Luis elige un numero del dado: " + SeleccionTercerJugador);

                    //IMPRIMIR EL NUMERO DEL DADO
                    Console.WriteLine("El dado cayo en el numero: " +clsDado.LanzarDado());    

                    

                    if (clsDado.LanzarDado()==SeleccionPrimerJugador)
                    {
                        clsJuego.Ganador = "KARINA";
                        Console.WriteLine("FELICIDADES "+clsJuego.Ganador+" GANASTE ESTA RONDA");
                        
                    }
                    if (clsDado.LanzarDado()==SeleccionSegundoJugador)
                    {
                        clsJuego.Ganador = "ANGEL";
                        Console.WriteLine("FELICIDADES "+clsJuego.Ganador+" GANASTE ESTA RONDA");
                        
                    }
                    if (clsDado.LanzarDado()==SeleccionTercerJugador)
                    {
                        clsJuego.Ganador = "LUIS";
                        Console.WriteLine("FELICIDADES "+clsJuego.Ganador+" GANASTE ESTA RONDA");
                        
                    }
                    if (clsDado.LanzarDado()!=SeleccionPrimerJugador && clsDado.LanzarDado()!= SeleccionSegundoJugador && clsDado.LanzarDado()!= SeleccionTercerJugador)
                    {
                        Console.WriteLine("TODOS HAN PERDIDO");
                    }     

                Console.WriteLine();
                clsDado.Rondas++;

            }while(clsDado.Rondas<16);
      

        }

      
        
    }

}
INFO