Beispiel #1
0
        static void Main(string[] args)
        {
            Console.Title = "Practica 05 - CardGame";

            #region Instances

            Baraja       deck = new Baraja();
            List <Carta> mazo = deck.CrearBaraja();
            deck = new Baraja(mazo);

            #endregion

            #region Ordered Decks

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("####### Initial Ordered Deck #######\n");
            deck.MostrarBaraja(mazo);

            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WriteLine("####### Ordered Deck [Fisher-Yates] #######\n");
            deck.MostrarBaraja(deck.SortCards(mazo));

            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("####### Ordered Deck [Common Sort] #######\n");
            mazo.Sort(Carta.CompareCards);
            deck.MostrarBaraja(mazo);

            #endregion

            Console.ReadKey();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Baraja bajaraEspañola = new Baraja();

            Console.WriteLine(Baraja.MostrarBaraja(bajaraEspañola));
            Console.ReadKey();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Baraja <string> baraja = new Baraja <string>();
            string          uno    = "uno ";
            string          dos    = "dos";
            string          tres   = "tres";

            baraja += dos;
            baraja += uno;
            baraja += tres;

            Console.WriteLine(baraja.MostrarBaraja());
            Console.ReadKey();

            Console.WriteLine(baraja.MostrarBaraja());
            Console.ReadKey();

            Console.WriteLine(baraja.MostrarBaraja());
            Console.ReadKey();
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Baraja barajaEspañola = new Baraja();
            Carta  testCarta      = new Carta((Carta.Valor) 5, (Carta.Palo) 2);

            Console.WriteLine(Baraja.MostrarBaraja(barajaEspañola));
            Carta ultimaCarta = Baraja.RetornarUltimaCarta(barajaEspañola);

            Console.WriteLine($"Ultima carta: {ultimaCarta.ObtenerNombre()}");
            barajaEspañola.AgregarCarta(testCarta);
            Console.WriteLine(Baraja.MostrarBaraja(barajaEspañola));
            barajaEspañola.MezclarBaraja(barajaEspañola);
            Console.WriteLine(Baraja.MostrarBaraja(barajaEspañola));
            Console.ReadKey();
        }