r/gaming • • Jun 25 '12

I was playing solitaire last night, and the computer didnt deal out a 5 of hearts...

[deleted]

254 Upvotes

927 comments sorted by

1.2k

u/ReanLu Jun 25 '12

Curious... I believe this image to be shopped!

→ More replies (138)

1.1k

u/SkunkMonkey Jun 25 '12

You've never picked up a real deck of cards to play solitaire only to realize that one of the cards was missing after you started playing?

Solitaire, taking card simulation to the next level!

→ More replies (37)

2.1k

u/snailbotic Jun 25 '12

For only 4.99$ You can get the 5-Of-Hearts DLC!

→ More replies (120)

31

u/mnighm Jun 25 '12 edited Jun 25 '12

As a programmer who wrote a solitaire program in college, I had the exact same thing happen randomly in a program I wrote. It was an issue in the shuffle algorithm. Basically I was taking the cards in the deck and randomly shoving them into a slot an array. If a card was already in that slot I would switch the cards and try and find a place for the existing card elsewhere. This is a stupid way to shuffle by the way, but that is what the professor wanted.

Unfortunately I was a smartass who thought he would make it easy on himself and define the array as one element larger than it needed to be. This was so that the first element of my array would be 1 not 0. However I did not have the bounds on the array set correctly. 0 could be used by the shuffle algorithm but not by anything else. There was a one in fifty-three chance that a card would end up in slot 0. My professor just so happened to have the bug pop up while he was testing my program.

EDIT: Forgot a word.

EDIT2: I was a dumb ass. There was a one in fifty-three chance that the bad slot would be empty. Had not thought about the math till today when bagelmanb called me out on it. I probably did not play the game all the way through to notice.

→ More replies (16)

1.1k

u/Lies_About_Expertise Jun 25 '12

Senior software developer here, and I can explain how it happened. What most likely happened was a developer got bored. I know when I get bored after coding for a while I add little things to the code. Just last week I was working on a soon to be released game, and added a line of code that gives the player a 1 in 10 million chance of randomly dying on any given turn (it's a turn based RPG). It's all great fun.

777

u/stefanopolis Jun 25 '12

Whew, almost fell for that one, you dirty scoundrel.

→ More replies (167)
→ More replies (58)

5

u/[deleted] Jun 25 '12

I'm really curious how this could have happened...

16

u/paleo_dragon Jun 25 '12

Clearly this is the dawn of skynet

→ More replies (1)

130

u/brumbrum21 Jun 25 '12

bad luck brain: plays one player game, gets cheated

→ More replies (2)

552

u/epicgeek Jun 25 '12

Did you check under the desk? Maybe it fell.

→ More replies (10)

112

u/[deleted] Jun 25 '12

Don't fight it, the house always wins.

→ More replies (5)

78

u/[deleted] Jun 25 '12

Does anybody else note the lack of a cursor on the screen? Or the lack of a selected card? He just dragged it off screen to take the screen shot. Now he's doing his happy "I just tricked those Redditards and got to the front page" dance.

→ More replies (2)

89

u/NewBlueBlood Jun 25 '12 edited Jun 25 '12

counting flowers on the wall, that don't bother me at all, playing Solitaire til dawn, with a deck of 51... edit:I accidentally a lyric (or two)

→ More replies (12)

56

u/dericpeace Jun 25 '12

Fine, BUT DEAR GOD, PLEASE PLAY THE 6 OF CLUBS!!!!!

→ More replies (2)

61

u/rnelsonee Jun 25 '12

Yup, it's a known bug. This is what happens when you don't have a dedicated test department, I suppose :)

18

u/CymbalBangingMonkey Jun 25 '12

What OS/solitaire program is that?

→ More replies (18)

8

u/makaveli151 Jun 25 '12

Also happened to me last week. Except they dealt me 2 Ace of Clubs. Figured I might as well post it as well.

14

u/[deleted] Jun 25 '12

I'd have flipped the table and shot the shit out of your PC. Cheating bastard.

6

u/BlackestNight21 Jun 25 '12

♫ playin solitaire til dawn, with a deck of fifty one... ♬

→ More replies (2)

6

u/Angry_Walnut Jun 25 '12

How could it be so heartless?

2

u/uselesslyskilled Jun 25 '12

That's only 34 cards. There's way more than that, that's missing

→ More replies (4)