void splitHand(){ if (2*bet<=chips){ sleep(1.5); pad(5); printf("You chose to split your cards.\n"); pad(10); printf("Starting First Split Hand:\n\n"); playerSplit[0] = player[1]; //save second card pcount = player[0].val; playerCardNum--; if (player[1].num=="A") aceP--; drawCard(0); showHand(0); cardCount(0); play(); if (input!=0){ //if player didnt bust or blackjack playDealer(); endRound(); } pad(10); printf("Starting Second Split Hand:\n"); player[0] = playerSplit[0]; pcount=playerSplit[0].val; playerCardNum=1; ccount=0; dealerCardNum=0; //reset values drawCard(1); showHand(1); if (player[0].num=="A") aceP=1; else aceP=0; drawCard(0); showHand(0); drawCard(1); cardCount(0); play(); } else{ pad(5); printf("You do not have enough chips to split hand. Hit or Stay.\n\n"); action(); } }
int main(){ setSeed(); //set random number seed beginGame(); //set chips=1000, print intro shuffle(); while (playing) { setup(); //shuffle deck, reset starting values makeBet(); //give initial bet amount dealBlackJack(); //deal player and dealer hands if (playerBlackjack()){ //check for player blackjack win(); input=0; } else play(); //player plays Hand if (input!=0){ //if player didnt bust or blackjack playDealer(); endRound(); } if (playing) { //continue to next round pad(15); printf("Next Round...\n\n"); } } }
static void gameOver(byte s) { endRound(); matrix.setLed(0, apple.y, apple.x, true); // In case the apple is off at that time strcpy_P(buffer, (char *) pgm_read_word(&(strings[GAME_OVER]))); printLcd(3, 0, buffer); switch (s) { case 0: strcpy_P(buffer2, (char *) pgm_read_word(&(strings[PLAYER_WIN]))); printLcd(0, 1, buffer2); printLcd(7, 1, "2"); snake[1].score++; break; case 1: strcpy_P(buffer2, (char *) pgm_read_word(&(strings[PLAYER_WIN]))); printLcd(0, 1, buffer2); printLcd(7, 1, "1"); snake[0].score++; break; case 2: strcpy_P(buffer2, (char *) pgm_read_word(&(strings[TIE]))); printLcd(4, 1, buffer2); } wipeMatrix(); delay(500); newRound(); }
static void newRound(void) { endRound(); snake[0].yDir = snake[1].yDir = 0; snake[0].length = snake[1].length = 3; snake[0].hasTurned = snake[1].hasTurned = false; snake[0].xDir = 1; snake[0].body.x[0] = 2; snake[0].body.y[0] = 1; snake[0].body.x[1] = 1; snake[0].body.y[1] = 1; snake[0].body.x[2] = 1; snake[0].body.y[2] = 2; snake[1].xDir = -1; snake[1].body.x[0] = 5; snake[1].body.y[0] = 6; snake[1].body.x[1] = 6; snake[1].body.y[1] = 6; snake[1].body.x[2] = 6; snake[1].body.y[2] = 5; generateApple(); apple.on = false; secondSnakeOn = false; countdown(start, menu); }
void Combat::jobFinished(unsigned long ticket) { if (ticket == mAnimationSequenceTicket) { endRound(); } }
static void gameOver(void) { endRound(); matrix.setLed(0, apple.y, apple.x, true); // In case the apple is off at that time strcpy_P(buffer, (char *) pgm_read_word(&(strings[GAME_OVER]))); printLcd(3, 1, buffer); wipeMatrix(); delay(500); newRound(); }
void GameController::playCard () { if ( model_ -> canPlayCard () ) { // If the player can play this card, play it, and go to the next player model_ -> playCard (); model_ -> nextPlayer (); endRound(); computerTurnLoop (); } else { // Otherwise throw exception throw IllegalPlayException (); } }
void GameController::computerTurnLoop () { // Keep looping as long as its a computer's turn while ( model_ -> currentPlayerIsComputer () ) { model_ -> takeTurnForCurrentPlayer (); model_ -> nextPlayer (); bool end = endRound(); // Break if a winner is found if ( end ) { break; } } }
void GameController::discardCard () { if ( model_ -> canDiscardCard () ) { // If the player can discard the card, discard it, and go to the next player model_ -> discardCard (); model_ -> nextPlayer (); endRound(); computerTurnLoop (); } else { // Otherwise throw exception throw IllegalDiscardException (); } }
void ACSUEBomb::bombExplode() { UE_LOG(LogTemp, Warning, TEXT("EXPLODE")); if(explosionFX) UGameplayStatics::SpawnEmitterAtLocation(this, explosionFX, GetActorLocation()); auto myGM = (ACSUEGameMode*)GetWorld()->GetAuthGameMode(); if (myGM) { myGM->endRound(FString(TEXT("t"))); } GetWorldTimerManager().ClearTimer(bombTimer); planted = false; }
static void newRound(void) { endRound(); snake.xDir = 1; snake.yDir = 0; snake.length = 3; snake.hasTurned = false; snake.body.x[0] = 2; snake.body.y[0] = 3; snake.body.x[1] = 1; snake.body.y[1] = 3; snake.body.x[2] = 1; snake.body.y[2] = 4; generateApple(); apple.on = false; countdown(start, menu); }
void Game::beforeClose(Context *nextContext) { endRound(); }
void Game::nextRound() { endRound(); startRound(); }
static void menu(byte data) { endRound(); showMenu(); }