Skip to content

Commit

Permalink
Added feature to skip question
Browse files Browse the repository at this point in the history
Skipping a question removes it from the deck.
  • Loading branch information
jeffechua authored Apr 12, 2018
1 parent be77bbf commit ffe1243
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ int test_card(struct Card **cards, int i, int size) {
return QUIT;
}

// If response is "\s", skip and remove from deck
if (strcmp(response, "\\s") == 0) {
printf("\n\n");
free(response);
return TRUE;
}

// Creates a blank string of minimum length 12 for alignment
int length = max(12, real_len(card.question)) + 1;
char *space = malloc(sizeof(char) * length);
Expand Down

0 comments on commit ffe1243

Please sign in to comment.