c++ - i violated D.R.Y. help me please? -


I am making a blackjack SIM and I want to deal with the card, how it will be in the casino,

< P> i.e.

But all players are dealt a card, the dealer faces a face, players get another card, the dealer gets the same face << p>

But look dormant to me vomiting :( How to do it again ??

  zero blackjack :: newHand () {for resetHands (); (unsigned Runt int i = 0; i  next card); card * c = deck-> next card (); C-> Set Visible (wrong); // Dealer face-down card dealer-> AdCard (C); (unsigned int i = 0; i & lt; players [i] ++) players ] -> AdCard (Deck-> Next Card ()); Dealer-> AdCard (Deck-> Next Card ());}  
" Post-text "itemprop =" text ">

Move duplicated code to another function:

  zero blackjack :: addDealerCard (bool) Dry granting) (card * C = Deck & gt; Next card (); C- & gt; Set visable (visible); Dealer-> AdCard (C);} zero blackjack :: addCards () {for (unsigned int i = 0; i  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -