Question: ( Generating the Waltz ) Write a program called generatewaltz.py that accepts the minuet and trio tables from standard input, generates a random sequence of

(Generating the Waltz ) Write a program called generatewaltz.py that accepts the minuet and trio tables from
standard input, generates a random sequence of 32 measures according to the rules described above, and writes the sequence
to standard output.. Create a 2D list called minuetMeasures with dimensions 1116(use stdarray.create2D())
Populate minuetMeasures with values read from standard input (use stdio.readInt())
Create a 2D list called trioMeasures with dimensions 616(use stdarray.create2D())
Populate trioMeasures with values read from standard input (use stdio.readInt())
For each j in [0,15]
- Set i to the sum of two die rolls (each a random number from [1,6])
- Write minuetMeasures[i 2][j] with a space after
For each j in [0,15]
- Set i to the value of a die roll (a random number from [1,6])
- Write trioMeasures[i 1][j] with a space after
Write a newline

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!