static void Main(string[] args)
        {
            Deck newDeck = new Deck();

            newDeck.shuffle();
            foreach (Card cardVal in newDeck.cards)
            {
                Console.WriteLine(cardVal.stringVal + " of " + cardVal.Suit);
            }
            foreach (Card cardVal in newDeck.cards)
            {
                Console.WriteLine(cardVal.stringVal + " of " + cardVal.Suit);
            }
            Player erick = new Player("Erick");

            erick.draw(newDeck);
            erick.draw(newDeck);
            erick.draw(newDeck);
            erick.draw(newDeck);
            erick.draw(newDeck);

            foreach (Card uniqueCard in erick.hand)
            {
                Console.WriteLine("MY HAND: " + uniqueCard.stringVal + " of " + uniqueCard.Suit);
            }

            erick.discard(1);
        }
        static void Main(string[] args)
        {
            Deck newDeck = new Deck();

            // newDeck.topMost(); //Removes the top card from the deck
            // newDeck = new Deck(); //Resets the deck to 52 cards
            newDeck.shuffle();
            // foreach (var item in newDeck.cards)
            // {
            //     System.Console.WriteLine(item.stringVal + " of " + item.suit);
            // }
            // System.Console.WriteLine("***********************************");
            Player frank     = new Player("Frank");
            var    card      = frank.drawCard(newDeck);
            Card   cardDrawn = card as Card;

            System.Console.WriteLine("Card removed from deck " + cardDrawn.stringVal + " of " + cardDrawn.suit);
            // foreach (var item in newDeck.cards)
            // {
            //     System.Console.WriteLine(item.stringVal + " of " + item.suit);
            // }
            // System.Console.WriteLine("***********************************");
            // System.Console.WriteLine(frank.hand.Count);
            System.Console.WriteLine("Cards in my hand " + frank.hand[0].stringVal + " of " + frank.hand[0].suit);
            System.Console.WriteLine("Number of card left in the deck " + newDeck.cards.Count);
            System.Console.WriteLine("Number of cards in my hand " + frank.hand.Count);
            frank.discard(cardDrawn);
            System.Console.WriteLine(frank.hand.Count);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Player player1 = new Player("Mark");

            Console.WriteLine("=====================");
            Console.WriteLine("Initializing the Deck");
            Console.WriteLine("=====================");

            Deck deck1 = new Deck();

            Console.WriteLine("=====================");
            Console.WriteLine(" Shuffling the Deck");
            Console.WriteLine("=====================");

            deck1.shuffle();
            Console.WriteLine("=====================");
            Console.WriteLine(" Player - Draw cards");
            Console.WriteLine("=====================");
            drawing(player1, deck1);
            drawing(player1, deck1);
            drawing(player1, deck1);
            drawing(player1, deck1);
            drawing(player1, deck1);
            Console.WriteLine("Deck Count is: {0}", deck1.cards.Count);



            Console.WriteLine("=====================");
            Console.WriteLine(" Resetting the Deck");
            Console.WriteLine("=====================");


            deck1.resetDeck();
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Deck deck = new Deck();

            deck.shuffle();
            deck.display();
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            // Create a players list and a new deck, then shuffle the deck.
            List <Player> players = new List <Player>();
            Deck          deck    = new Deck();

            deck.shuffle();


            // Create new players and add them to the player list.
            Player Michael = new Player("Michael");

            players.Add(Michael);
            Player John = new Player("John");

            players.Add(John);


            // Each player draws 5 cards.
            for (int i = 1; i <= 5; i++)
            {
                Console.WriteLine("Michael Drawing...");
                Michael.draw(deck);

                Console.WriteLine("John Drawing...");
                John.draw(deck);
            }


            // List out each player's hand.
            Console.WriteLine("PLAYERS HANDS");
            List <Card> michaelHand = Michael.Hand;

            for (int i = 0; i < michaelHand.Count; i++)
            {
                Console.WriteLine("Player : " + Michael.Name + "--- Count: " + (i + 1));
                michaelHand[i].GetInfo();
            }
            List <Card> JohnHand = John.Hand;

            for (int i = 0; i < JohnHand.Count; i++)
            {
                Console.WriteLine("Player : " + John.Name + "--- Count: " + (i + 1));
                JohnHand[i].GetInfo();
            }


            // Reset the deck and player hands.
            for (int i = 0; i < players.Count; i++)
            {
                Player player = players[i];
                for (int j = player.Hand.Count - 1; j >= 0; j--)
                {
                    player.discard(j);
                }
            }
            deck.reset();
        }
Beispiel #6
0
        public static void Main(string[] args)
        {
            Card myCard  = new Card("Clubs", 6);
            Card myCard2 = new Card("Hearts", 1);
            Deck myDeck  = new Deck();

            Console.WriteLine(myDeck);
            myDeck.shuffle();
            Console.WriteLine(myDeck);
        }
Beispiel #7
0
        static void Main(string[] args)             // This is where we call our functions
        {
            Player chelsea = new Player("Chelsea"); // Enter Chelsea! Yay!
            Deck   myDeck  = new Deck();            // Creates a new deck of cards

            myDeck.shuffle();                       // Shuffle the deck
            chelsea.draw(myDeck);                   // Draw a card from the deck
            chelsea.discard(0);                     // Remove a card from the deck
            myDeck.deal();                          // Deals a card from the deck
            myDeck.reset();                         // Reset the deck of cards
        }
Beispiel #8
0
        static void Main(string[] args)
        {
            Deck myDeckofCards = new Deck();                  //this is looking at the deck class for the deck function(the constructor function)

            // myDeckofCards.showDeck();                         //this is the deck method function on a specific instance
            // Cards pullCard = myDeckofCards.Deal();
            // System.Console.WriteLine(pullCard.suit);
            // System.Console.WriteLine(pullCard.stringVal);
            // System.Console.WriteLine(pullCard.val);
            // myDeckofCards.reset();
            // myDeckofCards.showDeck();
            myDeckofCards.shuffle();
        }
Beispiel #9
0
        static void Main(string[] args)
        {
            Deck deck = new Deck();

            deck.deal();
            deck.reset();
            deck.shuffle();
            deck.show();
            Player p1 = new Player("Bob");

            p1.draw(deck);
            Console.WriteLine(p1.discard(0));
            Console.WriteLine(p1.discard(0));
        }
Beispiel #10
0
        static void Main(string[] args)
        {
            Deck myDeck = new Deck();

            Console.WriteLine("Dealing: " + myDeck.deal().ToString());
            myDeck.reset();
            myDeck.shuffle();
            Player ali = new Player("Ali");

            ali.draw();
            ali.draw();
            ali.draw();
            ali.discard(2);
        }
Beispiel #11
0
        static void Main(string[] args)
        {
            Deck pokerDesk = new Deck();

            pokerDesk.shuffle(52);
            for (int i = 0; i < 52; i++)
            {
                Console.Write("{0, -15}", pokerDesk.DealCard());
                if ((i + 1) % 13 == 0)
                {
                    Console.WriteLine();
                    Console.WriteLine();
                }
            }
            Console.ReadLine();
        }
Beispiel #12
0
        static void Main(string[] args)
        {
            // Console.WriteLine("Hello World!");
            Deck d1 = new Deck();

            d1.shuffle();
            Player tom = new Player("Tom");

            tom.draw(d1);
            tom.draw(d1);
            tom.draw(d1);
            tom.draw(d1);
            tom.draw(d1);
            tom.discard(1);
            tom.display();
        }
Beispiel #13
0
        static void Main(string[] args)
        {
            Player dave    = new Player("Dave");
            Deck   fivetwo = new Deck();

            fivetwo.reset();
            fivetwo.shuffle();
            dave.showHand();
            dave.draw(fivetwo);
            dave.draw(fivetwo);
            dave.draw(fivetwo);
            dave.draw(fivetwo);
            dave.draw(fivetwo);
            dave.showHand();
            dave.discard(2);
            dave.showHand();
        }
Beispiel #14
0
 public void startGame()
 {
     deck = deck.shuffle();
     Console.WriteLine("Dealing Cards to Player and House...");
     player.drawCard(deck);
     house.drawCard(deck);
     player.drawCard(deck);
     house.drawCard(deck);
     Console.WriteLine("Player hand:");
     player.showHand();
     Console.WriteLine("Player has:");
     playerpoints = player.showHandVal();
     Console.WriteLine("House hand:");
     house.showHand();
     Console.WriteLine("House has:");
     housepoints = house.showHandVal();
 }
Beispiel #15
0
        static void Main(string[] args)
        {
            Deck newDeck = new Deck();

            // newDeck.reset();
            newDeck.shuffle();
            // newDeck.deal();
            // newDeck.deal();

            Player alex = new Player("Alexander");

            // alex.draw(newDeck.deal());
            alex.draw(newDeck);
            alex.draw(newDeck);
            alex.draw(newDeck);

            alex.discard(2);
        }
Beispiel #16
0
        static void Main(string[] args)
        {
            Deck KimDeck = new Deck();

            // KimDeck.printAll();
            KimDeck.shuffle();
            // foreach (Card item in KimDeck.cards)
            // {
            //     KimDeck.printAll();
            // }
            Player Kim = new Player("Kim");

            Kim.draw(KimDeck);
            Kim.draw(KimDeck);
            Kim.draw(KimDeck);
            Kim.draw(KimDeck);
            Kim.draw(KimDeck);
            Kim.discard(2);
        }
Beispiel #17
0
        public static void Main(string[] args)
        {
            Deck rummydeck = new Deck();

            Card removedcard = rummydeck.deal();

            rummydeck.shuffle();

            rummydeck.reset();

            Player Don = new Player("Don");

            Card cardret = Don.draw(rummydeck);

            Card cardret2 = Don.draw(rummydeck);

            Card cardret3 = Don.draw(rummydeck);

            Card Discard = Don.discard(5);
        }
Beispiel #18
0
        static void Main(string[] args)
        {
            Deck Deck1 = new Deck();
            Deck Deck2 = new Deck();

            Deck1.shuffle();
            Player Tyler  = new Player("Tyler");
            Player Kendal = new Player("Kendal");

            Tyler.Draw(Deck1);
            Kendal.Draw(Deck2);
            Tyler.Draw(Deck1);
            Kendal.Draw(Deck2);
            Tyler.Draw(Deck1);
            Kendal.Draw(Deck2);
            Tyler.Draw(Deck1);
            Kendal.Draw(Deck2);
            Tyler.Draw(Deck1);
            Kendal.Draw(Deck2);
            Tyler.Discard(3);
        }
Beispiel #19
0
        static void Main(string[] args)
        {
            Deck myDeck = new Deck();

            // myDeck.deal();
            // myDeck.deal();
            // myDeck.deal();
            // myDeck.reset();
            myDeck.shuffle();
            myDeck.deal();
            Player Art = new Player("Art");

            Art.draw(myDeck);
            Art.draw(myDeck);
            Art.draw(myDeck);
            Art.draw(myDeck);
            Art.draw(myDeck);

            Art.showHand();
            Art.discard(0);
            System.Console.WriteLine();
            Art.showHand();
        }
Beispiel #20
0
        public static void Main(string[] args)
        {
            Deck myDeck = new Deck();

            myDeck.shuffle();
            Player myPlayer = new Player("user1");

            myPlayer.draw(myDeck);
            myPlayer.draw(myDeck);
            myPlayer.draw(myDeck);
            myPlayer.draw(myDeck);
            myPlayer.draw(myDeck);
            foreach (Card card in myPlayer.hand)
            {
                Console.WriteLine("{0} of {1}", card.stringValue, card.suit);
            }
            myPlayer.Discard(2);
            Console.WriteLine("@@@@@@@@@@@@@@@@@");
            foreach (Card card in myPlayer.hand)
            {
                Console.WriteLine("{0} of {1}", card.stringValue, card.suit);
            }
        }
Beispiel #21
0
 public Player(string name)
 {
     this.name = name;
     deck.shuffle();
 }
Beispiel #22
0
 /// <summary>
 /// Facade method to Shuffle a Deck
 /// </summary>
 /// <param name="deck">Deck</param>
 public void UserShufflesDeck(Deck deck)
 {
     deck.shuffle();
     Console.WriteLine("\nDeck Shuffled!!");
 }
 static void Main(string[] args)
 {
     Deck myDeck = new Deck();
     Console.WriteLine("Before Shuffle: ");
     myDeck.showCards();
     Console.WriteLine("*****************");
     Console.ReadKey();
     myDeck.shuffle();
     Console.WriteLine("After Shuffle: ");
     myDeck.showCards();
     Console.ReadKey();
 }