More ffi for choices and the like

This commit is contained in:
Dane Johnson
2022-01-19 09:57:20 -06:00
parent 8d23af431e
commit e0e54bd34b
2 changed files with 70 additions and 4 deletions

View File

@@ -35,6 +35,12 @@ int main() {
storybook_advance_nooption(book);
break;
case (FOOTER_CHOICES):
int n = storybook_get_num_choices(book);
for (int i = 1; i <= n; i++) {
Choice* choice = storybook_get_choice(book, i);
printf("%d) %s\n", choice->option, choice->flavor);
storybook_free_choice(choice);
}
uint32_t option;
printf("Make a choice: ");
scanf("%d", &option);