Timeline for WinForms dice roller
Current License: CC BY-SA 4.0
27 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 11, 2024 at 23:54 | history | edited | radarbob | CC BY-SA 4.0 | added 55 characters in body |
| Sep 9, 2024 at 16:41 | history | edited | radarbob | CC BY-SA 4.0 | edited body |
| Jun 28, 2024 at 5:46 | history | edited | radarbob | CC BY-SA 4.0 | added 102 characters in body |
| Jun 10, 2020 at 13:24 | history | edited | CommunityBot | Commonmark migration | |
| Apr 13, 2017 at 12:40 | history | edited | CommunityBot | replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/ | |
| Dec 4, 2015 at 15:25 | history | edited | radarbob | CC BY-SA 3.0 | deleted 9 characters in body |
| Dec 3, 2015 at 20:04 | history | edited | radarbob | CC BY-SA 3.0 | Added Roll(n), with commentary |
| Dec 3, 2015 at 19:59 | history | edited | radarbob | CC BY-SA 3.0 | Added Roll(n), with commentary |
| Dec 3, 2015 at 19:30 | history | edited | radarbob | CC BY-SA 3.0 | "add a constructor" changed to "Change default constructor" |
| Dec 3, 2015 at 19:13 | history | edited | radarbob | CC BY-SA 3.0 | Link to OPs comment on use of .NET Random class |
| Oct 28, 2013 at 19:58 | history | edited | radarbob | CC BY-SA 3.0 | Fixed the fix for the indexer |
| Oct 28, 2013 at 18:10 | history | edited | radarbob | CC BY-SA 3.0 | Fix return type for Dice indexer |
| Oct 28, 2013 at 8:55 | comment | added | ChrisWue | This should not compile. Your Dice indexer claims to return a Die but it actually calls Roll() on a Die. | |
| Oct 26, 2013 at 6:27 | comment | added | radarbob | Make a 3-sided die if needed. Do not make a 6-sided die then hack the Die class to shreds trying to force it to act like a 3, 4, 20, etc. sided die. I suppose a 1-sided die is not practical but the ensuing discussion of N-fold space would be fun. | |
| Oct 26, 2013 at 6:17 | comment | added | radarbob | Roll(), RollSome(count), RollSome(count, sides)... whoa! - why not just a Roll(count) overload? Roll() uses all dice and Roll(n) rolls n dice. One way to say "roll the dice". consistent, clean. Also, the RollSome(count,sides) smells like a game rule misplaced as a confusing dice method. Die hitCountDice = new Die(4); hitCountDice.Roll() in a Game class of some kind is far superior to Dice.RollSome(1,4). What in the Wide World of Sports is that supposed to mean? | |
| Oct 26, 2013 at 2:33 | comment | added | Mathieu Guindon | I don't know Risk 2210, but then maybe in that case RollSome(int) could have a RollSome(int count, int sides) overload, to roll count dice with sides number of sides, so RollSome(2, 3) would roll 2x 3-faced dice (of course that would physically be 6 faces with 1-3 showing up twice), and perhaps throw some NotSupportedException if there are no such dice. | |
| Oct 26, 2013 at 2:03 | comment | added | Robert Snyder | I would suggest renaming Roll() with RollAll(), and adding RollSome(int) method into your Dice class. Since it is a collection, and we use those verbs when playing a dice game it would be good to have that in there. RollSome could be tricky though if you have a game where you roll different side die (such as Risk 2210) | |
| Oct 24, 2013 at 17:40 | comment | added | Dan Lyons | +1 Also, since this is in c#, Dice.Roll could be shortened even further with LINQ to return dice.Sum(d => d.Roll()); | |
| Oct 24, 2013 at 15:33 | comment | added | Mathieu Guindon | Note that this isn't a code review per se, it's really a continuation of my answer, picking up where I left off (I left out any object-oriented approach suggestion on purpose, to leave room for answers like this). One thing about DI: it's also addictive - and when you start having more complex dependencies which have their own dependencies which have their own dependencies, consider looking into an IoC container; take a look at Ninject for example. The IoC container does all the newing-up for you :) | |
| Oct 24, 2013 at 15:01 | review | Suggested edits | |||
| Oct 24, 2013 at 16:08 | |||||
| Oct 24, 2013 at 14:46 | vote | accept | Andy Hoffman | ||
| Oct 24, 2013 at 14:43 | comment | added | Andy Hoffman | I really appreciate your advice on this. I'll be making changes:) I would like to make a huge note that this: This is one 6 sided thing. It can be rolled. Random class - use the .NET Framework! is absolute garbage for rolling random numbers in something like dice. go check it out its trash... if you check out my repository i compared that to RNG CRYPTO Service and a mersenne twister and the rng crypto was the only one worthy of rolling dice. | |
| Oct 24, 2013 at 4:34 | comment | added | Mathieu Guindon | Epic answer yourself! +12 if I could! | |
| Oct 24, 2013 at 4:15 | history | edited | radarbob | CC BY-SA 3.0 | added 4 characters in body |
| Oct 24, 2013 at 4:05 | history | edited | radarbob | CC BY-SA 3.0 | deleted 74 characters in body |
| Oct 24, 2013 at 3:56 | history | edited | radarbob | CC BY-SA 3.0 | added 193 characters in body |
| Oct 24, 2013 at 3:26 | history | answered | radarbob | CC BY-SA 3.0 |