Timeline for A dice game called "Greed"
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 15, 2018 at 23:16 | comment | added | thegreatemu |
regarding the globals: IMHO this is one of the few good circumstances to use static s within the function. Only one initialization on first call, no messy globals, no annoying extra parameters to pass
|
|
Nov 15, 2018 at 23:08 | comment | added | TemporalWolf |
@scohe001 if the point bonus for 3 is broken up (100 each plus 700 in bonus points), you can just add 700 instead of 1000, which simplifies score += 100 * count[1] to get the individual rolls. The same logic applies to 5s as well.
|
|
Nov 15, 2018 at 17:29 | comment | added | scohe001 |
Note that your double loops for "counting logic" could probably be replaced by: score += 1000 * (count[1] / 3); score += 100 * (count[1] % 3);
|
|
Nov 15, 2018 at 1:07 | history | edited | Errorsatz | CC BY-SA 4.0 |
added 375 characters in body
|
Nov 15, 2018 at 1:05 | comment | added | ChubakBidpaa | Thank you. I don't know what templates are yet, but once I learn about them (in a few hours) I will make use of them. | |
Nov 15, 2018 at 1:01 | history | answered | Errorsatz | CC BY-SA 4.0 |