Advertisement
stamen4o

Print a Deck of 52 Cards

Mar 26th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3. class Deck52Cards
  4. {
  5. static void Main()
  6. {
  7. Console.OutputEncoding = Encoding.Unicode;
  8. Console.Title = "Print a Deck of 52 Cards";
  9. Console.WriteLine("This program will print all possible 52 cadrs from a deck.");
  10. char clubs = '\u2663';
  11. char spades = '\u2660';
  12. char diamonds = '\u2666';
  13. char hearts = '\u2665';
  14. char[] arrSym = new char[] { clubs,spades,diamonds,hearts};
  15. char[] arrChar = new char[] { 'A','J','Q','K'};
  16. for (int deck = 2; deck <= 10; deck++)
  17. {
  18. for (int hand = 0; hand < arrSym.Length; hand++)
  19. {
  20. Console.Write("{0}{1} ",deck,(char)arrSym[hand]);
  21. }
  22. Console.WriteLine();
  23. }
  24. for (int i = 0; i < arrChar.Length; i++)
  25. {
  26. for (int k = 0; k < arrSym.Length; k++)
  27. {
  28. Console.Write("{0}{1} ",arrChar[i],arrSym[k]);
  29. }
  30. Console.WriteLine();
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement