Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void updateScore (GameView currView, char *pastPlays)
- {
- // start score
- int score = GAME_START_SCORE;
- // start update
- score -= currView->currRound * SCORE_LOSS_DRACULA_TURN;
- //Duplicate string
- char *pastPlaysDup = strdup (pastPlays);
- char *currPlays;
- for (currPlays = strtok (pastPlaysDup, " "); currPlays != NULL; currPlays = strtok (NULL, " ")) {
- if ((currPlays[0] == 'D') && (currPlays[5]) == 'V'){
- score = score - SCORE_LOSS_VAMPIRE_MATURES;
- }
- }
- currView->gameScore = score;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement