| 730 | } |
| 731 | |
| 732 | staticfn char * |
| 733 | improvised_notes(boolean *same_as_last_time) |
| 734 | { |
| 735 | static const char notes[7] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G' }; |
| 736 | /* target buffer has to be in svc.context, otherwise saving game |
| 737 | * between improvised recitals would not be able to maintain |
| 738 | * the same_as_last_time context. */ |
| 739 | |
| 740 | /* You can change your tune, usually */ |
| 741 | if (!(Unchanging && svc.context.jingle[0] != '\0')) { |
| 742 | int i, notecount = rnd(SIZE(svc.context.jingle) - 1); /* 1 - 5 */ |
| 743 | |
| 744 | for (i = 0; i < notecount; ++i) { |
| 745 | svc.context.jingle[i] = ROLL_FROM(notes); |
| 746 | } |
| 747 | svc.context.jingle[notecount] = '\0'; |
| 748 | *same_as_last_time = FALSE; |
| 749 | } else { |
| 750 | *same_as_last_time = TRUE; |
| 751 | } |
| 752 | return svc.context.jingle; |
| 753 | } |
| 754 | |
| 755 | /* |
| 756 | * So you want music... |
no test coverage detected