Question: You found 4 wooden cubes. Each cube has six faces. How to display all the 365 (or 366) dates in a year, can you write

You found 4 wooden cubes. Each cube has six faces. How to display all the 365 (or 366) dates in a year, can you write function that takes the date as a string (or a null-terminated character array in C), such as "September 13" and then decide what to display on the 4 cubes? Using 0-5 as the indices of the faces in a cube, your answer could be a 4-element array, such as [-1, 2, 3, 1], meaning that first cube won't be used (indicated by a -1), the 3rd face (remember it is 0-based) of the second cube will be used, 4th face of the 3rd cube will be used and 2nd face of the 4th cube will be used.

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!