Unable to get “IsDouble” to work

public void notSplitOrDouble() 

{ take3rdCard();

if (vplayerCard1 != 11 || vplayerCard2 != 11 || vplayerCard3 != 11) { getHardpChoice(); } else { getSoftpChoice(); } if (pChoice == 1 || pChoice == 3 || handValue < 8) { take4thCard(); if (vplayerCard1 != 11 || vplayerCard2 != 11 || vplayerCard3 != 11 || vplayerCard4 != 11) { getHardpChoice(); } else { getSoftpChoice(); } if (pChoice == 1 || pChoice == 3 || handValue < 8) { take5thCard(); if (vplayerCard1 != 11 || vplayerCard2 != 11 || vplayerCard3 != 11 || vplayerCard4 != 11 || vplayerCard5 != 11) { getHardpChoice(); } else { getSoftpChoice(); } if (pChoice == 1 || pChoice == 3 || handValue < 8) { take6thCard(); if (vplayerCard1 != 11 || vplayerCard2 != 11 || vplayerCard3 != 11 || vplayerCard4 != 11 || vplayerCard5 != 11 || vplayerCard6 != 11) { getHardpChoice(); } else { getSoftpChoice(); } if (pChoice == 1 || pChoice == 3 || handValue < 8) { take7thCard(); } } } } 

}

public void Main() 

{
switchFacecards(); getPlayerCardValues(); handValue = vplayerCard1 + vplayerCard2;

if (vplayerCard1 + vplayerCard2 == 21) { isBlackJack = true; } if (playerCard1 != playerCard2 && vplayerCard1 != 11 && vplayerCard2 != 11) { getHardpChoice(); if (pChoice == 3) { isDouble = true; take3rdCard(); } if (pChoice == 1 || handValue < 8) { notSplitOrDouble(); } } if (playerCard1 == playerCard2) { getDoublepChoice(); if (pChoice == 4) { isSplit = true; } if (pChoice == 3) { isDouble = true; take3rdCard(); } if (pChoice == 1 || handValue < 8) { notSplitOrDouble(); } } if (playerCard1 != playerCard2 && playerCard1 == 1 || playerCard2 == 1) { getSoftpChoice(); if (pChoice == 3) { isDouble = true; take3rdCard(); } if (pChoice == 1 || handValue < 8) { notSplitOrDouble(); } } 

}

 public bool IsDouble 

{ get { Main(); return isDouble; }
}

by Andykatz14 via /r/csharp

Leave a Reply