Ejemplo n.º 1
0
        public void DisplayCards()
        {
            Console.Clear();
            Console.BackgroundColor = ConsoleColor.Gray;
            int x = 0; // position of cursor. we move it left and right
            int y = 1; // y position of curser, we move it up and down.

            // display player hand
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.WriteLine("Players's Hand");
            for (int i = 0; i < 5; i++)
            {
                DrawCards.DrawCardOutline(x, y);
                DrawCards.DrawCardSuitValue(sortedPlayerHand[i], x, y);
                x++;
            }
            y = 15; //move the row of computer cards below the player's cards
            x = 0;  //reset x position
            Console.SetCursorPosition(x, y - 1);
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("Computers Hand");
            for (int i = 5; i < 10; i++)
            {
                DrawCards.DrawCardOutline(x, y);
                DrawCards.DrawCardSuitValue(sortedComputerHand[i - 5], x, y);
                x++;
            }
        }
Ejemplo n.º 2
0
        public void DisplayCards()
        {
            Console.Clear();
            int x = 0; //Horizontal position of cursor
            int y = 1; //Vertical position of cursor

            //Display player hand
            Console.ForegroundColor = ConsoleColor.DarkMagenta;
            Console.WriteLine("Players hand");
            for (int i = 0; i < 2; i++)
            {
                DrawCards.DrawCardOutline(x, y);
                DrawCards.DrawCardSuitValue(PlayerHand[i], x, y);
                x++;//Move right for next card
            }

            y = 15; //Move the row of CPU cards down below the players
            x = 0;
            //Display flop
            Console.SetCursorPosition(x, 14);
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("Flop");
            for (int i = 0; i < 5; i++)
            {
                DrawCards.DrawCardOutline(x, y);
                DrawCards.DrawCardSuitValue(FlopHand[i], x, y);
                x++;//Move right for next card
            }


            y = 29; //Move the row of CPU cards down below the players
            x = 0;
            //Display CPU hand
            Console.SetCursorPosition(x, 28);
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            Console.WriteLine("Computers hand");
            for (int i = 0; i < 2; i++)
            {
                DrawCards.DrawCardOutline(x, y);
                DrawCards.DrawCardSuitValue(ComputerHand[i], x, y);
                x++;//Move right for next card
            }
        }