Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. static void updateScore (GameView currView, char *pastPlays)
  2. {
  3. // start score
  4. int score = GAME_START_SCORE;
  5.  
  6. // start update
  7. score -= currView->currRound * SCORE_LOSS_DRACULA_TURN;
  8.  
  9. //Duplicate string
  10. char *pastPlaysDup = strdup (pastPlays);
  11.  
  12. char *currPlays;
  13. for (currPlays = strtok (pastPlaysDup, " "); currPlays != NULL; currPlays = strtok (NULL, " ")) {
  14. if ((currPlays[0] == 'D') && (currPlays[5]) == 'V'){
  15. score = score - SCORE_LOSS_VAMPIRE_MATURES;
  16. }
  17. }
  18.  
  19. currView->gameScore = score;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement