Silverblade The Ench
First Post
Hey guys, I thought that "random" algorithims were not very random? Always used to see annoying streaks with them? 
(or maybe they were just bad formulas?)

(or maybe they were just bad formulas?)
Mercule said:Here goes:
Here's the code from a button that calls it:
Code:private void btnRoll_Click(object sender, EventArgs e) { Dice roller = new Dice(txtFormula.Text); lblResult.Text = roller.Roll().ToString(); }
Asmor said:You should really toss some error handling in there... your class throws an exception for unexpected syntax.
Asmor said:You should really toss some error handling in there... your class throws an exception for unexpected syntax.
Also, in general the built-in random functions are of pretty poor quality, regardless of language. I haven't done much research in the area, but the Mersenne Twister algorithm seems to be one of the best, and there's a version of it already made for all the popular languages (here's a C# implementation).
Mercule said:Such is the nature of things resident in my pile of incomplete projects. And exactly the reason I posted the code with caveat.
Geez.... I post a snippet of code that someone might be able to build off of -- or not -- and I get criticized because it's not full-featured? You're welcome.
I appreciate the post. It's a good helpful start to putting together a more fully featured program. Excellent.Mercule said:Such is the nature of things resident in my pile of incomplete projects. And exactly the reason I posted the code with caveat.
Geez.... I post a snippet of code that someone might be able to build off of -- or not -- and I get criticized because it's not full-featured? You're welcome.
Asmor said:I apologize if I offended you, it was not my intent. I was just trying to offer some advice.