You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.3KB

  1. #include <iostream>
  2. #include "base.h"
  3. void Hand::draw(bool holeCardShown) {
  4. for (auto it : cards) {
  5. std::cout << " _____ ";
  6. }
  7. std::cout << std::endl;
  8. unsigned int i = 0;
  9. for (auto it : cards) {
  10. if (holeCardShown || i != 1) {
  11. std::cout << "|" << card[it].getNumberASCII() << ((card[it].number != 10)?" ":"") << " | ";
  12. } else {
  13. std::cout << "|#####| ";
  14. }
  15. i++;
  16. }
  17. std::cout << std::endl;
  18. i = 0;
  19. for (auto it : cards) {
  20. if (holeCardShown || i != 1) {
  21. std::cout << "| | ";
  22. } else {
  23. std::cout << "|#####| ";
  24. }
  25. i++;
  26. }
  27. std::cout << std::endl;
  28. i = 0;
  29. for (auto it : cards) {
  30. if (holeCardShown || i != 1) {
  31. std::cout << "| " << card[it].getSuitUTF8() << " | ";
  32. } else {
  33. std::cout << "|#####| ";
  34. }
  35. i++;
  36. }
  37. std::cout << std::endl;
  38. i = 0;
  39. for (auto it : cards) {
  40. if (holeCardShown || i != 1) {
  41. std::cout << "| | ";
  42. } else {
  43. std::cout << "|#####| ";
  44. }
  45. i++;
  46. }
  47. std::cout << std::endl;
  48. i = 0;
  49. for (auto it : cards) {
  50. if (holeCardShown || i != 1) {
  51. std::cout << "|___" << ((card[it].number != 10)?"_":"") << card[it].getNumberASCII() << "| ";
  52. } else {
  53. std::cout << "|#####| ";
  54. }
  55. i++;
  56. }
  57. std::cout << std::endl;
  58. return;
  59. }