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(); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); Deck myDeck = new Deck(); myDeck.reset(); Player Marco = new Player("Marco"); Marco.Draw(myDeck); }
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 }
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)); }
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); }
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(); }
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); }