Jump to content
  • entries
    4,247
  • comments
    2,525
  • views
    1,750,581

Making a video poker game

Sign in to follow this  
atari2600land

301 views

So after a whole bunch of hours programming, I finally have the beginnings of a video poker game.
blogentry-9475-0-26704500-1537822670.png
It took a while to get it just right. A few problems were in the way. One was that it kept giving me two king of clubs sometimes. I think I have that problem gone now. Another was sometimes it was ignoring pairs. Again, I think I have that problem gone now.

The next step in programming is to make a hand icon and make it allow players to keep cards and then redeal the cards they don't keep and then rank the cards.

I had a very hard time trying to put the code for the ranking in, but I finally made it so the cards it ranks are mine. I had to change my card getting code so that it gave me two values, one between 1-13 and another between 1-4, instead of just one that was between 1-52. This next step will be hard because I again have to make sure it doesn't give me duplicate cards.

Sign in to follow this  


6 Comments


Recommended Comments

Since this is a Virtual Boy game, I have no idea how many bytes are taking up what.

I am using C, so I can tell you that I am using Suitnumber[0]-[4] for the suits and Cardnumber[0]-[4] for the types of cards (A-K).

Share this comment


Link to comment

One efficient way to shuffle a deck of cards:

for i = 1 to 52

j = random(52) + 1

c = deck

deck = deck[j]

deck[j] = c

next i

Share this comment


Link to comment

You can always create your own PRNG. The shortest one would be a LFSR, and there are other concepts if you don't have access to bit manipulation. Actually a PRNG should be part of your library, whether it is available as a ROM routine or your own code.

Share this comment


Link to comment

Thanks, but the VB has no random number generator.

 

You will need one. How else do you plan to shuffle the cards?

Share this comment


Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...