My submitted project looks, in retrospect, a little unreadable but I did try to comment the code appropriately. My Die Rich craps implementation is contains:
- 2 while loops
- 1 for loop
- 4 if/else statements
- 2 if statements
- 4 if-else-if laddered statements.
So, I am in the process of rewriting it to be a little shorter and slightly more testable. I have a rough & incomplete sketch which goes:
1) Create a Players class which will contain key variables that are unique to each instance of the Players class and a final static class variable which applies to all members of the Players class.
2) Create the DieRich class file (which includes the main method)
That’s as far as I’ve gotten. So far, it’s a good experiment to think about breaking the program/project into tasks and writing code accordingly.
I visited a software product company recently and I learned that tests (regression and unit tests) are exceedingly important & take up just as much time as coding does! The developer I ‘shadowed’ walked me through the process of unit testing which I will try to implement in my projects this semester.