You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#31
Re: Casino game for VB
Posted on: 5/11 10:42
PVB Elite
Joined 2008/4/26
USA
919 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (10 Years) PVBCC 2010 EntryPVBCC 2013 Entry
Anyone here an expert of Craps (the casino dice game)?

I'm trying to make a version of Craps using the rules in Wikipedia: https://en.wikipedia.org/wiki/Craps

I've got pass and don't pass bets and what I think are basic rules down, but since I've never played the game, I don't know if they're correct or not. Check out what I've got so far and a ROM and code zip file here: http://www.atari2600land.com/casino/casino20180511.zip

Let me know what you think so far.
Top

#32
Re: Casino game for VB
Posted on: 5/11 13:21
Virtual Freak
Joined 2006/10/2
98 Posts
ContributorLong Time User (11 Years)
Craps is a very difficult game to learn. I watched someone trying to teach it, and it was mind-boggling how many rules there were. Who in the heck even came up with something like that???
Top

#33
Re: Casino game for VB
Posted on: 5/11 23:12
PVB Elite
Joined 2008/4/26
USA
919 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (10 Years) PVBCC 2010 EntryPVBCC 2013 Entry
I think I got the Come/Don't Come bets in. I'm using the Hoyle website for these rules now. http://www.hoylegaming.com/rules/showrule.aspx?RuleID=206
To turn on/off a Come bet, press the Left Trigger button. To turn on/off a Don't Come bet, press the Right Trigger button. As per rules, you can only make a Come/Don't Come bet after a non-crapping out/non-winning roll.
Top

#34
Re: Casino game for VB
Posted on: 7/12 12:58
VUE(xpert)
Joined 2007/10/27
Sweden
412 Posts
ContributorLong Time User (10 Years) 40+ Game Ratings
Good work man. I love how you make game after game and never give up
Top

#35
Re: Casino game for VB
Posted on: 9/23 8:37
PVB Elite
Joined 2008/4/26
USA
919 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (10 Years) PVBCC 2010 EntryPVBCC 2013 Entry
Just poking my head in to say "hi, I'm back working on my casino game."

No craps, I've decided it was too tough to program and learn, so I'm going to attempt to replace it with a version of Video Poker.

Attach file:



png  videopokerscreen.png (1.40 KB)
768_5ba734a3516b0.png 384X224 px
Top

#36
Re: Casino game for VB
Posted on: Yesterday 1:37
PVB Elite
Joined 2008/4/26
USA
919 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (10 Years) PVBCC 2010 EntryPVBCC 2013 Entry
So someone was kind enough to give me some code for ranking hands:

function rankHand()
{
var 
rank;
// sort hand into card rank order
for (i=1;i<=5;i++){
for (
j=i;j<=5;j++){
if (
rankHandRank[i] > rankHandRank[j])
{
tmpSuit rankHandSuit[i];
tmpRank rankHandRank[i];
rankHandSuit[i] = rankHandSuit[j];
rankHandRank[i] = rankHandRank[j];
rankHandSuit[j] = tmpSuit;
rankHandRank[j] = tmpRank;
}
}
}
// now rank the hand (1 is the highest)
if (rankHandSuit[1] == rankHandSuit[2] && rankHandSuit[2] == rankHandSuit[3] && rankHandSuit[3] == rankHandSuit[4] && rankHandSuit[4] == rankHandSuit[5] && rankHandRank[5] == 13 && rankHandRank[4] == 12 && rankHandRank[3] == 11 && rankHandRank[2] == 10 && rankHandRank[1] == 1)
{
    
rank 1;    // royal straight flush
}
else if (
rankHandSuit[1] == rankHandSuit[2] && rankHandSuit[2] == rankHandSuit[3] && rankHandSuit[3] == rankHandSuit[4] && rankHandSuit[4] == rankHandSuit[5] && rankHandRank[5] == (rankHandRank[4] + 1) && rankHandRank[4] == (rankHandRank[3] + 1) && rankHandRank[3] == (rankHandRank[2] + 1) && rankHandRank[2] == (rankHandRank[1] + 1))
{
rank 1;    // straight flush
}
else if (
rankHandRank[1] == rankHandRank[2] && rankHandRank[2] == rankHandRank[3] && rankHandRank[3] == rankHandRank[4]) 
{
rank 2;    // 4 of a kind
}
else if (
rankHandRank[2] == rankHandRank[3] && rankHandRank[3] == rankHandRank[4] && rankHandRank[4] == rankHandRank[5])
{
rank 2;    // 4 of a kind
}
else if (
rankHandRank[1] == rankHandRank[2] && rankHandRank[2] == rankHandRank[3] && rankHandRank[4] == rankHandRank[5]) 
{
rank 3    // full house
}
else if (
rankHandRank[3] == rankHandRank[4] && rankHandRank[4] == rankHandRank[5] && rankHandRank[1] == rankHandRank[2]) {
rank 3;   // full house
}
else if (
rankHandSuit[1] == rankHandSuit[2] && rankHandSuit[2] == rankHandSuit[3] && rankHandSuit[3] == rankHandSuit[4] && rankHandSuit[4] == rankHandSuit[5])
{
rank 4;    // flush
}
else if (
rankHandRank[5] == (rankHandRank[4] + 1) && rankHandRank[4] == (rankHandRank[3] + 1) && rankHandRank[3] == (rankHandRank[2] + 1) && rankHandRank[2] == (rankHandRank[1] + 1))
{
rank 5;    // straight
}
else if (
rankHandRank[5] == 13 && rankHandRank[4] == 12 && rankHandRank[3] == 11 && rankHandRank[2] == 10 && rankHandRank[1] == 1)
{
rank 5;    // straight
}
else if (
rankHandRank[1] == rankHandRank[2] && rankHandRank[2] == rankHandRank[3])
{
rank 6;   // 3 of a kind
}
else if (
rankHandRank[2] == rankHandRank[3] && rankHandRank[3] == rankHandRank[4])
{
rank 6;   // 3 of a kind
}
else if (
rankHandRank[3] == rankHandRank[4] && rankHandRank[4] == rankHandRank[5])
{
rank 6;   // 3 of a kind
}
else if (
rankHandRank[1] == rankHandRank[2] && rankHandRank[3] == rankHandRank[4])
{
rank 7;   // 2 pair
}
else if (
rankHandRank[2] == rankHandRank[3] && rankHandRank[4] == rankHandRank[5])
{
rank 7;   // 2 pair
}
else if (
rankHandRank[1] == rankHandRank[2] && rankHandRank[4] == rankHandRank[5])
{
rank 7;   // 2 pair
}
else if (
rankHandRank[1] == rankHandRank[2])
{
rank 8;
}
else if (
rankHandRank[2] == rankHandRank[3])
{
rank 8;
}
else if (
rankHandRank[3] == rankHandRank[4])
{
rank 8;
}
else if (
rankHandRank[4] == rankHandRank[5])
{
rank 8;
}
else
{
rank 0;
}
return 
rank;
}

Since it's Javascript, I tried to convert it to C. I also adapted my code for the cards. I now have strings:
Cardnumber and Suitnumber, each having numbers 0-4. I tried to merge the card ranking code into my game, but I don't know what I need to do to make the code read the strings and work. Could someone please help me? The videopoker routine starts at line 2,062 and goes until the end.

Attach file:


zip casino20180923code.zip Size: 9.54 KB; Hits: 2
Top

#37
Re: Casino game for VB
Posted on: Yesterday 8:03
PVB Elite
Joined 2008/4/26
USA
919 Posts
CoderContributorTop10 PosterHOTY09 3rdLong Time User (10 Years) PVBCC 2010 EntryPVBCC 2013 Entry
Testing time. After hours of work, I think I may have done it. I tested this for 10 minutes, and there was no missed pairs like the previous versions I had tried.
SO LET ME KNOW if you come across any instance where it missed a pair. Take a picture of it (F9 in Mednafen).
The next thing I will do is add an option to change cards and redeal it again. Because right now, pressing start over and over again just gives you new hand after new hand. I am doing this for test purposes. Get the latest ROM here:
http://www.atari2600land.com/casino/
Top

#38
Re: Casino game for VB
Posted on: Yesterday 9:16
VUE(xpert)
Joined 2007/10/27
Sweden
412 Posts
ContributorLong Time User (10 Years) 40+ Game Ratings
Welcome back and good luck. Nice to see you trying hard
Top

 Top   Previous Topic   Next Topic


Register To Post