I am a little new/rusty to this C++ stuff. Is this bad code? Can it be improved?#include <windows.h>#include <string>#include <iostream>#include <cstdlib>#include <ctime>bool _initialized_time = false;void Wait() {  std::cout << Prease any key to continue ... << std::endl;  std::cin.get();}void print(char* _value) {  std::cout << _value << std::endl;}char ConvertIntToChar(int _int) {  return (char)(((int)'0')+_int);}int ReturnRandomNumber(int _start, int _end) {  if(_initialized_time == false) {    _initialized_time = true;    srand(time(0));  }  int n = rand() % _end + _start;  return n;}void ClearConsoleWindow() {  for (int i = 0; i < 40; i++) {    std::cout <<                                                                                           ;  }}void Wait(int _mil){    Sleep(_mil); // wait 1 second}enum eCardType { // THE TYPES OF CARDS  cNothing = 0,  cAce = 1,  cTwo = 2,  cThree = 3,  cFour = 4,  cFive = 5,  cSix = 6,  cSeven = 7,  cEight = 8,  cNine = 9,  cTen = 10,   cJack = 11,  cKing = 12,  cQueen = 13,  cJoker = 14,cAceSmall = 15};enum eCardSuite { // THE SUITE OF THE CARDS  sNothing = 0,  sSpades = 1,   sHearts = 2,   sDiamonds = 3,sClubs = 4};enum ePlayerType { // PLAYER TYPE COMPUTER OR PLAYER  pPlayer = 1,  pComputer = 2,};struct card { // CARD STRUCT CONTAINS THE SUITE AND TYPE  enum eCardSuite cSuite;  enum eCardType cType;};card _deck[52]; // THE DECK WHICH CONTAINS THE CARDSconst int _deck_size = 52; // THE MAXIMUM SIZE OF A DECK OF CARDScard _player_cards[_deck_size]; // THE PLAYERS CARDScard _computer_cards[_deck_size]; // THE COMPUTERS CARDSbool _game_over = false; // IS THE GAME OVER OR NOTbool _hand_delt = false; // HAS THE HAND BEEN DELTchar _next_move = ' '; // THE NEXT MOVEconst int _computer_hit_threshold = 17; // IF THE VALUE IS OVER THE MAXIMUM, OR EQUAL TO IT, IT WILL STAYbool _player_stays = false; // DOES THE PLAYER STAYbool _computer_stays = false; // DOES THE COMPUTER STAYdouble _default_money = 2000.00; // DEFAULT MONEY AMOUNTdouble _default_bet = 100.00;double _player_money = 0.0; // AMOUNT PLAYER HASdouble _computer_money = 0.0; // AMOUNT COMPUTER HASbool _first_hit = true;double _pot = 0.0;double _temp_money = 0.0;bool _deck_empty = false;void ResetPlayerCards(ePlayerType _type) { // RESET PLAYER CARDS  switch(_type) {  case pPlayer:    for(int i = 0; i <= _deck_size - 1; i++) {      _player_cards[i].cSuite = sNothing;      _player_cards[i].cType = cNothing;    }    break;  case pComputer:    for(int i = 0; i <= _deck_size - 1; i++) {      _computer_cards[i].cSuite = sNothing;      _computer_cards[i].cType = cNothing;    }    break;  }}char* ReturnSuiteString(eCardSuite _suite) {  char* _result;  switch(_suite) {    case sNothing:      _result = ;      break;    case sSpades:      _result = Spades;      break;    case sHearts:      _result = Hearts;      break;    case sDiamonds:      _result = diamonds;      break;    case sClubs:      _result = clubs;      break;  }  return _result;}int ReturnCardValue(card _card) {  int _result;  switch(_card.cType) {    case cAceSmall:      _result = 1;      break;    case cAce:      _result = 10;      break;    case cTwo:      _result = 2;      break;    case cThree:      _result = 3;      break;    case cFour:      _result = 4;      break;    case cFive:      _result = 5;      break;    case cSix:      _result = 6;      break;    case cSeven:      _result = 7;      break;    case cEight:      _result = 8;      break;    case cNine:      _result = 9;      break;    case cTen:      _result = 10;      break;    case cJack:      _result = 10;      break;    case cQueen:      _result = 10;      break;    case cKing:      _result = 10;      break;    case cJoker:      _result = 0;      break;  }  return _result;}bool IsAce(card _card) {  bool _result = false;  if(_card.cType == cAce || _card.cType == cAceSmall) {    _result = true;  }  return _result;}bool IsValidCard(card _card) {  bool b = false;  if(_card.cSuite != sNothing && _card.cType != cNothing && _card.cType != cJoker) {    b = true;  }  return b;}int PlayerHandValue(ePlayerType _type) {  int _value = 0;  switch(_type) {    case pComputer:      for(int i = 0; i <= _deck_size - 1; i++) {        if(_computer_cards[i].cSuite != sNothing && _computer_cards[i].cType != cNothing && _computer_cards[i].cType != cJoker) {           _value = _value + ReturnCardValue(_computer_cards[i]);        }      }      break;    case pPlayer:      for(int i = 0; i <= _deck_size - 1; i++) {        if(_player_cards[i].cSuite != sNothing && _player_cards[i].cType != cNothing && _player_cards[i].cType != cJoker) {           _value = _value + ReturnCardValue(_player_cards[i]);        }      }      break;  }  return _value;}int PlayerCardCount(ePlayerType _type) {  int _add = 1;  int _count = 0;  switch(_type) {    case pComputer:      for(int i = 0; i <= _deck_size - 1; i++) {        if(_computer_cards[i].cSuite != sNothing && _computer_cards[i].cType != cNothing && _computer_cards[i].cType != cJoker) {           _count = _count + _add;         }      }      break;    case pPlayer:      for(int i = 0; i <= _deck_size - 1; i++) {        if(_player_cards[i].cSuite != sNothing && _player_cards[i].cType != cNothing && _player_cards[i].cType != cJoker) {           _count = _count + _add;        }      }      break;  }  return _count;}char* ReturnPlayerString(ePlayerType _type) {  char* _result;  switch(_type) {    case pPlayer:      _result = Player;      break;    case pComputer:      _result = Computer;      break;    }  return _result;}char* ReturnCardTypeString(eCardType _type) {  char* _result;  switch(_type) {    case cNothing:      _result = ;      break;    case cAceSmall:      _result = Ace;      break;    case cAce:      _result = Ace;      break;    case cTwo:      _result = Two;      break;    case cThree:      _result = Three;      break;    case cFour:      _result = Four;      break;    case cFive:      _result = Five;      break;    case cSix:      _result = Six;      break;    case cSeven:      _result = Seven;      break;    case cEight:      _result = Eight;      break;    case cNine:      _result = Nine;      break;    case cTen:      _result = Ten;      break;    case cJack:      _result = Jack;      break;    case cQueen:      _result = Queen;      break;    case cKing:      _result = King;      break;    case cJoker:      _result = Joker;      break;  }  return _result;}bool DoesMoreCardsExistInDeck() {  bool _more_exists = false;  for(int i = 0; i <= _deck_size - 1; i++) {    if(IsValidCard(_deck[i])) {      _more_exists = true;      break;    }  }  return _more_exists;}card TakeNextCard() {  card _new_card;  for(int i = 0; i <= _deck_size - 1; i++) {    if(IsValidCard(_deck[i])) {      _new_card = _deck[i];      _deck[i].cSuite = sNothing;      _deck[i].cType = cNothing;      break;    }  }  return _new_card;}card GiveCard(ePlayerType _player_type, bool _show_computer = false) {  bool _say = false;  int _count = 0;  card _new_card;  _new_card.cSuite = sNothing;  _new_card.cType = cNothing;  if(DoesMoreCardsExistInDeck() == true) {    _new_card =  TakeNextCard();    switch(_player_type) {      case pComputer:        _count = PlayerCardCount(pComputer);        _computer_cards[_count] = _new_card;        if(_show_computer == true) {          _say = true;        }        break;      case pPlayer:        _count = PlayerCardCount(pPlayer);        _player_cards[_count] = _new_card;        _say = true;        break;    }    if(_say == true) {      std::cout << ReturnPlayerString(_player_type) <<  received  << ReturnCardTypeString(_new_card.cType) <<  of  << ReturnSuiteString(_new_card.cSuite) << std::endl;    } else {      std::cout << ReturnPlayerString(_player_type) <<  received an undisclosed card. << std::endl;    }  } else {    print(Deck Empty);    _deck_empty = true;  }  return _new_card;}bool IsCardAlreadyInDeck(card _card) {  bool _result = false;  for(int i = 0; i <= _deck_size - 1; i++) {    if(IsValidCard(_deck[i])) {      if(_card.cSuite == _deck[i].cSuite && _card.cType == _deck[i].cType) {        _result = true;      }    }  }  return _result;}int CanUseCard(card _cards[], card _card) {  bool _can_use = true;  int _temp_card_count = 0;  int _count;  for(int i = 0; i <= _deck_size - 1; i++) {    if(_card.cSuite != sNothing && _card.cType != cNothing && _card.cType != cJoker) {      if((_cards[i].cSuite == _card.cSuite) && (_cards[i].cType == _card.cType)) {        _temp_card_count++;      }    }  }  if(_card.cType == cAceSmall) { _can_use = false; }  if(IsCardAlreadyInDeck(_card) == true) { _can_use = false; }  if(_card.cSuite == sNothing || _card.cType == cNothing || _card.cType == cJoker) { _can_use = false; }  if(_temp_card_count == 4) { _can_use = false; }  return _can_use;}void ShuffleDeck() {  int i = 0;  _deck_empty = false;  for(int i = 0; i <= _deck_size - 1; i++) {    _deck[i].cSuite = sNothing;    _deck[i].cType = cNothing;  }  int _count = 0;  for(int i = 0; i <= _deck_size - 1; i++) {    card _new_card = {sNothing, cNothing};    int _continue = 1;    while(_continue == 1) {      _new_card.cSuite = (eCardSuite)ReturnRandomNumber(1, 4);      _new_card.cType = (eCardType)ReturnRandomNumber(1, 13);      if(CanUseCard(_deck, _new_card) == true) {        _continue = 0;        _deck[_count] = _new_card;        _count = _count + 1;      }    }  }}void Reset() {  _first_hit = true;  ClearConsoleWindow();  ResetPlayerCards(pPlayer);  ResetPlayerCards(pComputer);  _computer_stays = false;  _player_stays = false;  _hand_delt = true;  GiveCard(pComputer, true);  GiveCard(pPlayer, true);  GiveCard(pComputer, true);  GiveCard(pPlayer, true);}void PromptNewGame() {  std::cin >> _next_move;  switch(_next_move) {    case 'p':      Reset();      break;    case 'q':      _game_over = true;      break;  }}void UpdateLastCard(ePlayerType _type, card _card) {  int _count = 0;  _count = PlayerCardCount(_type) - 1;  if(_type == pPlayer) {    _player_cards[_count] = _card;  } else if (_type == pComputer) {    _computer_cards[_count] = _card;  }}void RewardWinner() {  if(PlayerHandValue(pPlayer) > PlayerHandValue(pComputer)) {    if(PlayerHandValue(pPlayer) >= 22) {      std::cout << Computer Wins! Player:  << PlayerHandValue(pPlayer) << , Computer:  << PlayerHandValue(pComputer) << std::endl;      _computer_money = _computer_money - _default_bet + _pot;      _player_money = _player_money - _default_bet;      _pot = 0.0;    } else {      std::cout << Player Wins! Player:  << PlayerHandValue(pPlayer) << , Computer:  << PlayerHandValue(pComputer) << std::endl;      _player_money = _player_money + _default_bet + _pot;      _computer_money = _computer_money - _default_bet;      _pot = 0.0;    }  } else if (PlayerHandValue(pPlayer) == PlayerHandValue(pComputer)) {    std::cout << Draw! Player:  << PlayerHandValue(pPlayer) << , Computer:  << PlayerHandValue(pComputer) << std::endl;    _player_money = _player_money - _default_bet;    _computer_money = _computer_money - _default_bet;    _pot = _pot + _default_bet;  } else if(PlayerHandValue(pComputer) > PlayerHandValue(pPlayer)) {    if(PlayerHandValue(pComputer) >= 22) {      std::cout << Player Wins! Player:  << PlayerHandValue(pPlayer) << , Computer:  << PlayerHandValue(pComputer) << std::endl;      _player_money = _player_money + _default_bet + _pot;      _computer_money = _computer_money - _default_bet;      _pot = 0.0;    } else {      std::cout << Computer Wins! Player:  << PlayerHandValue(pPlayer) << , Computer:  << PlayerHandValue(pComputer) << std::endl;      _computer_money = _computer_money + _default_bet + _pot;      _player_money = _player_money - _default_bet;      _pot = 0.0;    }  }}void Initialize() {  ShuffleDeck();  _computer_money = _default_money;  _player_money = _default_money;  card _temp_card;  do {    if(_player_money == 0) {      print(sorry, you are out of money [q]);      std::cin >> _next_move;      if(_next_move == 'q') {        _game_over = true;      }    } else if(_default_bet > _player_money) {      std::cout << You only have  << _player_money <<  but the bet is currently  << _default_bet <<  [q] << std::endl;      std::cin >> _next_move;      if(_next_move == 'q') {        _game_over = true;      }    } else {      if(_player_stays == true && _computer_stays == true) {        RewardWinner();        if(_player_money == 0) {          std::cout << You are out of money [q] Quit << std::endl;          std::cin >> _next_move;          if(_next_move == 'q') {            _game_over = true;          }        } else if(_default_bet > _player_money) {          std::cout << You only have  << _player_money <<  but the bet is currently  << _default_bet <<  [q] << std::endl;          std::cin >> _next_move;          if(_next_move == 'q') {            _game_over = true;          }        } else {          std::cout << [p] Play Again [q] Quit << std::endl;          PromptNewGame();        }      } else {        if(PlayerHandValue(pPlayer) >= 22) {          RewardWinner();          if(_player_money == 0) {            std::cout << Player Busted with  << PlayerHandValue(pPlayer) << ! You are out of money [q] Quit << std::endl;            std::cin >> _next_move;            if(_next_move == 'q') {              _game_over = true;            }          } else if(_default_bet > _player_money) {            std::cout << You only have  << _player_money <<  but the bet is currently  << _default_bet <<  [q] << std::endl;            std::cin >> _next_move;            if(_next_move == 'q') {              _game_over = true;            }          } else {            std::cout << Player Busted with  << PlayerHandValue(pPlayer) << ! [p] Play Again [q] Quit << std::endl;            PromptNewGame();          }        } else {          if(_hand_delt == false) { Reset(); }          if(_first_hit == true) {            std::cout << Cards:  << PlayerCardCount(pPlayer) << , Hand Value:  << PlayerHandValue(pPlayer) << , Money:  << _player_money << . << std::endl;            if(_deck_empty == true) {              std::cout << [d] Shuffle Deck [s] Stay [c] Change bet amount [q] Quit << std::endl;            } else {              std::cout << [h] Hit Me [s] Stay [c] Change bet amount [q] Quit << std::endl;            }            _first_hit = false;          } else {            if(_deck_empty == true) {              std::cout << Cards:  << PlayerCardCount(pPlayer) << , Hand Value:  << PlayerHandValue(pPlayer) << , Money:  << _player_money << . [d] Shuffle Deck [s] Stay [q] Quit << std::endl;            } else {              std::cout << Cards:  << PlayerCardCount(pPlayer) << , Hand Value:  << PlayerHandValue(pPlayer) << , Money:  << _player_money << . [h] Hit Me [s] Stay [d] Shuffle Deck [q] Quit << std::endl;            }          }          std::cin >> _next_move;          switch(_next_move) {            case 'd':              if(_deck_empty) {                ShuffleDeck();                break;              }            case 'c':              if(_first_hit == true) {                if(_pot == 0) {                  std::cout << You currently have:  << _player_money <<  the current bet is  << _default_bet << . Enter the new default amount:  << std::endl;                } else {                  std::cout << You currently have:  << _player_money <<  the current bet is  << _default_bet << . There is  << _pot <<  in the pot. Enter the new default amount:  << std::endl;                }                std::cin >> _temp_money;                if(_temp_money >= _default_bet) {                  _default_bet = _temp_money;                } else {                  std::cout << You cannot bet that much, because you don't have enough money. << std::endl;                }              }              break;            case 'q':              _game_over = true;              break;            case 'h':              _temp_card = GiveCard(pPlayer);              if(_temp_card.cType == cAce) {                std::cout << Select Ace [1] Ace (10 Points) [2] Ace (1 Points);                std::cin >> _next_move;                switch(_next_move) {                  case '1':                    _temp_card.cType = cAce;                    break;                  case '2':                    _temp_card.cType = cAceSmall;                    break;                }                UpdateLastCard(pPlayer, _temp_card);              }              break;            case 's':              _player_stays = true;              do {                _temp_card = GiveCard(pComputer, true);                if(_deck_empty == true) {                  ShuffleDeck();                }                if(PlayerHandValue(pComputer) >= 22) {                    RewardWinner();                  if(_player_money == 0) {                    std::cout << Computer Busted with  << PlayerHandValue(pComputer) << ! You are out of money [q] Quit << std::endl;                    std::cin >> _next_move;                    if(_next_move == 'q') { _game_over = true; }                  } else if(_default_bet > _player_money) {                    std::cout << Computer Busted with  << PlayerHandValue(pComputer) <<  but the bet is currently  << _default_bet <<  [q] << std::endl;                    std::cin >> _next_move;                    if(_next_move == 'q') { _game_over = true; }                  } else {                    std::cout << Computer Busted with  << PlayerHandValue(pComputer) << ! [p] Play Again [q] Quit << std::endl;                    PromptNewGame();                  }                  ResetPlayerCards(pComputer);                  break;                }              } while (PlayerHandValue(pComputer) < PlayerHandValue(pPlayer));              _computer_stays = true;              break;          }        }      }    }  } while (!_game_over);}int black_jack() {  Initialize();  Wait();  return 0;}
Blackjack game with many conditionals and switches
c++;beginner;game;playing cards