Create a program that will store the results of your dice game in a comma separated value file (filename.csv). You will use the Formatter API to construct a new file. Your file name will use the current-datetime for its name and each time your program runs, a new file will be created (i.e. 20130314.10:00:01-DieResults.csv). Once you have a file generated, you will populate it with the rolls of two die objects along with the roll number and date/time of each roll. Each round of your game must have a winner, so if the results of your die are equal, you must roll again. Your program will also output the die results to the screen.
- Program implements Die Object
- Program implements Player Object
- Program accepts user input for counter controlled repetition or sentinel controlled repetition, which tracks number of rounds played for each game
- Since each round must have a winner, your program will include an inner loop to check and re-cast die in case of a tie
- Program imports Calendar to construct a proper datetime in the following format: MM/DD/yyyy HH:mm:ss
- CSV file is named and generated correctly and can be opened in MS Excel
- Outputs program authorship, including your RAM ID, Date and Course Number
- You will also save your .csv file as an MS Excel file (hw4.xlsx) and analyze the results
- Create a summary table and pie chart to showcase Player 1's vs. Player 2's win totals (see illustration below).
Sample CSV Output
Roll Number, Winner, Prof, Opp, DateTime
1,Prof,4,2,03/21/2013 09:15:24
2,Prof,2,1,03/21/2013 09:15:50
3,Opp,5,6,03/21/2013 09:16:14
4,Prof,3,1,03/21/2013 09:20:23
5,Opp,4,5,03/21/2013 09:21:03
6,Opp,5,6,03/21/2013 09:21:24
7,Prof,3,2,03/21/2013 09:21:54