Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Problem 4. Print a Deck of 52 Cards
- Write a program that generates and prints all possible cards from a standard deck of 52 cards (without the jokers).
- The cards should be printed using the classical notation (like 5♠, A♥, 9♣ and K♦). The card faces should start
- from 2 to A. Print each card face in its four possible suits: clubs, diamonds, hearts and spades.
- Use 2 nested for-loops and a switch-case statement.*/
- using System;
- class PrintADeckOf52Cards
- {
- static void Main()
- {
- string[] suits = new string[4] {"\u2663", "\u2666", "\u2665", "\u2660"};
- string[] cards = new string[13] {"2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"};
- for (int i = 0; i < cards.Length; i++)
- {
- for (int j = 0; j < suits.Length; j++)
- {
- Console.Write(cards[i] + suits[j] + " ");
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement