Monday, September 10, 2007

Random Number Bug Fixed

Thanks all to who posted a comment in response to my first thread.

Special thanks to 'Anonymous' who suggested that there may be a flaw in the randomization of the cards.

After reading their comment, I investigated the random number generator in more depth.
I created a page to test the deck shuffling and create a visual result so I could clearly see if any non-random trends were evident.

To my surprise, there WAS a bug!

The shuffler tended to favor keeping like numbered cards together and deal lower numbered cards before higher ones.

I've just implemented new randomizing code that appears to be much more random.
I cannot see any trends at all with this new code and truly appears to be random.

Sorry about the bug folks, but they happen :)

Thanks to everyone who is playing and I love receiving e-mails from you.
Bug reports, praise or any other type of feedback is welcomed!

8 comments:

Pete said...

Nice catch Robert!

I can positively confirm that Spider is now not so easy in the early stages, as getting cards that fit nicely is much more difficult!

To be honest this bug made things more difficult sometimes too (getting a rash of Kings or Aces from the unused card pile).

--
BoredByPolitics

Pete said...

Before I forget - another couple of observations...

If you change the deck during a game, the timer subsequently stops advancing.

Spider: When using Undo it is possible to undo individually the cards that have been played from the deck onto the bottom of the stacks - surely if you Undo cards played from the deck they should all be undone in one motion? I've not tried playing the game after part undoing a deal from the deck, as I would consider this cheating (why cheat when you're playing solitaire?) - but if play was allowed to continue then surely this would be cheating?

--
BoredByPolitics

Robert said...

@pete:

I'll be fixing BOTH of these bugs tonight. Thank you a lot for bringing them to my attention!

Oh, and don't worry, the timer stopping when changing decks does NOT affect the winning statistics thus the Leaderboard entries are still accurate.

Anonymous said...

I HATE YOU.

I play this game every single day, and I'm never not amazed at your incredible attention to detail, card image options, backgrounds, menus, ... You have a really wonderful application here! OK, time ot play some more.

Oh, one other note, it's nice that at this age in my life, I can't afford to site down and play games for 3 hours. This allows me to get a little play time in, and the auto-play helps even more!

You are awesome. Thanks so much!

Anonymous said...

Robert,

I'm the same Anonymous who posted about the random number bug. Thanks for taking a look--it's waay better now!

Robert said...

@anonymous #1 and #2

Thank you both for posting comments.
I really appreciate your feedback (both good and bad) as it helps to encourage me to keep going and make the game better by fixing things!

Thanks again and I hope you enjoy playing :)

Zellyn said...

Just for fun, since you mentioned shuffles... http://www.cigital.com/papers/download/developer_gambling.php

Here's wikipedia on shuffling: http://en.wikipedia.org/wiki/Fisher-Yates_shuffle

I love the site - very nicely done!

Anonymous said...

I don't really think that the random number thing was fixed. It still seems as if the cards are grouped. Is it just me?