Archive for 2013

this took me awhile to figure out and I’ve had to change it on occasion after some pokerstars updates, besides the PS updates, it’s never failed.

I included the GetText declarations because It’s simple to first grab any text you may be typing in the pokerstars chat enter area at the moment the sub fires, save it as a string somewhere, and then replace it after the sub has sent the programmed chat. This will keep any text you’re typing to the table from being wiped out by the Sub.

use the sub like this:  SendChatToPokerstarsTable(“nice hand”)

Martin Carter – psxpoker.com
PrivateConst WM_SETTEXT = &HC 
PrivateConst WM_GETTEXT = &HD 
PublicConst WM_CHAR = &H102

PublicDeclareFunction GetWindowTextLength Lib“user32.dll”Alias“GetWindowTextLengthA” (ByVal hWnd AsLong) AsLong

PublicDeclareFunction GetWindowText Lib“user32.dll”Alias“GetWindowTextA” (ByVal hWnd AsLong, ByVal prmstrString AsString, ByVal nMaxCount AsLong) AsLong

PublicDeclareFunction FindWindow Lib“user32”Alias“FindWindowA” (ByVal lpClassName AsString, ByVal lpWindowName AsString) AsInteger

PublicDeclareFunction FindWindowEx Lib“user32”Alias“FindWindowExA” (ByVal hWnd1 AsInteger, ByVal hWnd2 AsInteger, ByVal lpsz1 AsString, ByVal lpsz2 AsString) AsInteger

PublicDeclareFunction SendMessageSTRING Lib“user32”Alias“SendMessageA” (ByVal hwnd AsInteger, ByVal wMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsString) AsInteger

DeclareFunction sendmessagebynum& Lib“user32”Alias“SendMessageA” (ByVal hWnd AsInteger, ByVal wMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsInteger)

PublicSub SendChatToPokerstarsTable(ByVal Chat)

Dim pokerstarstableframeclass AsLong = FindWindow(“pokerstarstableframeclass”, vbNullString)

Dim pokerstarschateditorclass AsLong = FindWindowEx(pokerstarstableframeclass, 0&, “pokerstarschateditorclass”, vbNullString)

If pokerstarschateditorclass = 0 Then

Exit Sub

Else

Call SendMessageSTRING(pokerstarschateditorclass, WM_SETTEXT, 0&, Chat)

Call sendmessagebynum(pokerstarschateditorclass, WM_CHAR, 13, 0)

EndIf

EndSub

 

You can also loop thru a textbox and instantly send multilines of text to the table.

Dim ChatLines() AsString = Split(TextBox1.Text, vbNewLine)

ForEach line In ChatLines

If line = “” Then line = “.”

 SendChatToPokerstarsTable(line)

Next

PLEASE DONT SPAM THE TABLES WITH THESE CODES! THIS IS FOR “NICE HAND” or “PAYOUTS AS FOLLOWS…” ETC!

6 Comments so far. Join the Conversation
   

By , INVESTOR’S BUSINESS DAILY

Caesars Entertainment (CZR) and 11 other Atlantic City casinos have begun  the process of getting Internet gaming permits ahead of a Sunday deadline set by  New Jersey regulators.

They’re part of a rush to get in on the ground floor as online gambling gets  ready to go mainstream nationwide.

New Jersey will in November be the third state to launch statewide online  poker and other gaming, after Nevada and Delaware.

A sample poker game is played on the Ultimate Gaming website in Las Vegas of April 29, 2013. The Trump Taj Mahal casino in Atlantic City, N.J., has...A sample poker game is played on the  Ultimate Gaming website in Las Vegas

The new gaming outlet became possible when the federal government did an  about-face in December 2011. After adamantly opposing online gambling for years,  the government said states could issue licenses, but must limit gambling to  residents who live within that state.

Las Vegas casinos Las Vegas Sands (LVS), the world’s largest casino resort operator,  MGM Resorts International (MGM) and Wynn Resorts (WYNN) are expected to jump into online  gambling.

Sands, MGM and Wynn all have multibillion-dollar hotel casino complexes in  Macau and rely on it for the bulk of their growth.

Former Portuguese colony Macau, on China’s southern coast across the straits  from Hong Kong, is the world’s top gambling destination and fastest-growing.

Caesars, which missed the boat to Macau, hopes to rake in the chips online.  Analysts project the online gambling revenue opportunity in New Jersey alone at  $500 million to $1 billion annually.

Analysts speculate online companies such as leading social network Facebook (FB), which offers non-money games now,  might join the party. Facebook rose 0.5% Wednesday.

Caesars fell 1.2% Wednesday in stock market trading.

Sands was unchanged, MGM Resorts rose 0.4% and Wynn Resorts edged down  fractionally.

Caesars has focused mainly on its U.S. properties and is one of the biggest  casino operators in Atlantic City. It also has resorts in Las Vegas and Reno,  Nev., Baltimore, New Orleans, Philadelphia and other U.S. cities, as well as in  Cairo, London and Emerald, South Africa.

It was one of the first to file for a permit earlier this year.

Caesars CEO Gary Loveman told reporters on a May earnings calls, “We’re  pursuing emerging opportunities, including real-money online gaming in the  United States and international expansion.

“The successful launch of real-money online gaming in Nevada and New Jersey  could be a model for other states considering the legalization of online  gaming,” Loveman added.

Like other casinos, Caesars is teaming with an established online gaming  company. The four Atlantic City casinos owned by Caesars paired with European  online gaming operator 888 Holdings.

The Trump Taj Mahal casino signed an agreement with Las Vegas-based Ultimate  Gaming to bring online gambling to New Jersey. In April, Ultimate Gaming  launched online poker in Nevada.

And Atlantic City’s Borgata Hotel Casino, jointly owned by an MGM divestiture  trust and Boyd Gaming (BYD), teamed with British territory Gibraltar-based  Bwin.Party. Boyd fell 0.5% Wednesday.

 

Be the first to comment
   
By
Monday, July 8th, 2013
American Gaming Association Once Again Not Backing PokerStars Atlantic City Deal        While PokerStars may be celebrating its recent deal to partner with the Atlantic City land-based casino Resorts in an Internet gambling venture, not everyone is thrilled about the turn of events.

More specifically, the American Gaming Association, a powerful gambling industry group, says that it plans to oppose PokerStars’ entry into the regulated New Jersey online gambling market.

AGA previously came out against Atlantic Club deal

Earlier this year, the AGA made headlines when it announced that it did not support a now defunct deal that PokerStars was negotiating to take over a struggling Atlantic City casino, the Atlantic Club Casino Hotel.

The agreement began to unravel in April, when the Atlantic Club notified the parent company of PokerStars, Isle of Man-based the Rational Group, that it was terminating the purchase contract owing to the fact that the Rational Group failed to secure an interim operating license to run the casino prior to a drop-dead date stipulated in the contract.

PokerStars sued to be able to complete the purchase, however earlier this month a judge upheld an earlier court decision that ruled in favor of the Atlantic Club. The two companies had been negotiating the takeover since last year, and despite the fact that early rumors put the purchase price in the $50 million range, the actual price of $15 million came as a shock to many. Even more shocking was the fact that PokerStars had already paid $11 million of that sum before the deal began to come undone, money which the Atlantic Club is permitted to keep under the terms of the contract.

For its part, the AGA is opposed to PokerStars operating any form of business in the United States, be it a land-based casino or an online poker room, because of what it sees as PokerStars’ flouting of the UIGEA by continuing to offer US-facing online poker games after the law was enacted back in 2006.

Newly-retired former president backs online gambling, just not PokerStars 

Last month the AGA underwent a major change when its CEO and president, Frank Fahrenkopf, stepped down from his leadership role. Fahrenkopf announced his plans to turn over the helm of the group several months ago, however he plans to stay on as a consultant through 2013. While Fahrenkopf backs regulation of online gambling at the federal level, he has been vocally opposed to PokerStars’ inclusion in the US market.

Even without Fahrenkopf, who until last month was the only president the organization has known since its founding back in 1994, the group plans to maintain its opposition to PokerStars operating in the United States. Both PokerStars and Resorts will need to be licensed separately by the New Jersey Department of Gaming Enforcement before they can launch real-money online gambling sites. Industry pundits have posited that PokerStars has a very good chance of winning the approval of regulators, considering the fact that the company was quite close to completing the process when the Atlantic Club deal fell apart.

Speaking to the changes the US gambling industry has seen since the AGA’s inception nearly two decades ago, the Nevada-born Fahrenkopf told USA Today back in January, “We’re a mainstream part of the economy now, with hundreds of thousands of people employed in casinos nationwide. We do polls every year and it’s pretty consistent: 15 percent of people oppose all forms of gambling. You’ll never change them and all we can do is respect their views. But 80 percent believe gaming is all right, and that’s a very positive thing for our industry.”

Fahrenkopf previously served as the chairman of the Republic National Committee from 1983 until he left that post in 1989.

Be the first to comment
   

New “per seat” poker HUD addon to PSxP 2

Posted July 9, 2013 By martin

top: test light, player name, amount of hands
left: vp$ip, steal %, fold to steal %
mid: FTB pre, FTB, flop, FTB turn, FTB river (fold vs call a bet)
right: win% and AGG, sees flop-turn-rvr,  bets vs calls, wins-UCwins-loss

I set this data up so it will actually be usefull this time. Very easy to read at a glance. Lets hope its quick and updates nice. I’m ganna finish the coding this week and test next weekend.

IM GOING TO CEDAR POINT FRIDAY! weeeeeeeeeeeeeee

   



bluebar

   Displaying large amounts of data in small areas with the visual benefit of status bars or “bar graphs” is great. Doing this within a poker app requires the graphs to have two, three, four, or even five data values to display for each player’s action. I searched for a control that would handle the problem but had no results. here is my solution.

In each example above, I made three labels…

  • set each back color to the desired color
  • set the text alignment to left-center
  • set the heights to the desired height of the entire control
  • set the widths to the desired width of the entire control
  • set the locations the same

You can make a fourth label, 2 pixels larger, that is bordered for the background and make these three borderless for a nice affect.
You can use picture boxes and stretch images to create an even better effect. Whatever you have time for. ( I have made some very nice controls with this method)

 

 

Private Sub DisplayIt(lbl1 As Label, lbl2 As Label, lbl3 As Label, val1 As Integer, val2 As Integer, val3 As Integer)

Martin Carter – psxpoker.com

 ‘the percentage of graph used by each label, times 200 pixels (the width of the control)

lbl1.Width = val1 / (val1 + val2 + val3) * 200

lbl2.Width = val2 / (val1 + val2 + val3) * 200

lbl3.Width = val3 / (val1 + val2 + val3) * 200

 ‘the position of the 2nd and 3rd labels

lbl2.Left = (lbl1.Left + lbl1.Width)

lbl3.Left = (lbl2.Left + lbl2.Width)

 
‘print the values on the labels

lbl1.Text = Math.Round(val1 / (val1 + val2 + val3) * 100) & “%”

lbl2.Text = Math.Round(val2 / (val1 + val2 + val3) * 100) & “%”

lbl3.Text =Math.Round(val3 / (val1 + val2 + val3) * 100) & “%”

End Sub

 

‘use the sub like this…

 

PrivateSub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

Call DisplayIt(Label1, Label2, Label3, 11, 17, 5)

‘remember to handle the “isnumeric” exeption when passing the values

‘if 1 value is 0 then the other 2 labels will fill the control with the correct %

 EndSub

 

I use these controls to display “wins-uncalled wins-losses”, “bets preflop-flop-turn-river”, “in hand UTG-UTG+1-mid-mid+1-hijack-cutoff-button”. etc.

Be the first to comment
   

pokerstars HUD and Tracker

Posted July 7, 2013 By martin

toppic4

This is a free Pokerstars HUD project currently under development by us.

psxp2play

The App is always changing and growing to allow us to understang more and more about our game. It allows us to compare our play against other winning and losing players, and allows us to find and fix leaks in our game. As always it is free of malware, free of spam, and free to everyone. If you are a vb.net programmer and have a question about it, ask anything, anytime, it will get answered.

2 Comments so far. Join the Conversation
   

Delaware Releases Draft Online Gaming Regulations

 

The Government of the US state of Delaware has released the draft proposal of its online regulations for comment by the state’s public.

Delaware is set to launch an online gaming industry in September, which will follow Nevada, which was the first US state to launch regulated online gaming back in April. The draft regulations are 27 pages long are available for comment by the Delaware pubic until the end of July.

The draft regulations state that the Delaware State Lottery will oversee the state’s online gaming industry when it is established, which would be different to how Nevada and New Jersey’s industries are run. In those states, the online gaming industry is run by state gaming regulators.

 

 

article by Bruno  de Paiva

Be the first to comment
   

PokerStars Makes Deal to Enter Online Gaming Market in New JerseyPokerStars and Resorts Casino Hotel have announced a partnership agreement that will permit the world’s leading online poker site to provide online gaming software in New Jersey.

Just one day following the revelation that PokerStars was again prevented by New Jersey courts from succeeding in their quest to buy the Atlantic Club casino comes the news that parent company Rational Group has found another way to finagle into the U.S. market. The full details of the partnership agreement have not yet been released, but both companies are ecstatic to be joining forces.

“Resorts is a fantastic partner for us and we are looking forward to launch PokerStars in the U.S. in association with the other quality brands Resorts has brought to Atlantic City,” said Mark Scheinberg, Rational Group CEO.  “We are very happy to invest in New Jersey and we are excited about building a successful relationship with Resorts.”

Resorts Casino Hotel was the first brick and mortar to open on the Atlantic City boardwalk and has previously established partnerships with other brands such as Margaritaville and Mohegan Sun. “This [PokerStars] is another blue chip partner for Resorts to complete a wonderful series of brands,” Resorts’ Company Chairman Morris Bailey told a PRNewswire reporter.

New Jersey gaming officials must still approve the partnership agreement. It’s natural to assume that the American Gaming Association will again try to intervene in keeping PokerStars from gaining the green light to form an allegiance with the landmark casino.

PokerStars has been eyeing the U.S. online poker market for quite some time. Many believe that the deal brokered with the DoJ last year that saw Rational Group acquire Full Tilt Poker was done partly to get in the good graces of U.S. authorities. PokerStars did receive the DoJ’s blessing to enter the market if possible.

In the absence of federal online poker legislation, individual states have been enacting their own laws and some are including bad actor language to keep out the likes of PokerStars, who continued operating in the U.S. post-UIGEA. New Jersey has no such provisions in its statute, making the Garden State the best opportunity to get a foot in the door of the U.S. market.

That door has now been opened by Resorts Casino and PokerStars wants in. It will be up to state gaming officials to decide upon PokerStars’ suitability as a partner. PokerStars has shown tremendous tenacity in striving to be included in the newly-regulated online poker and gambling market in the U.S. I wouldn’t bet against them at this point.

 

article by Charles Rettmuller

 

Be the first to comment
   

 This will search the Pokerstars hand history folders on your comp and trigger an event when the size of one of those hand history files changes.

I set the timer to 3 seconds and get NO processor spike at all and it catches every append to pokerstars HH files in as many tables you are on. If you plan on parsing hands just split the string in the streamreader with (vbnewline & vbnewline & vbnewline) .  Add it to an array. You will have an array of every hand played in that HH file to parse any info you need after each hand completes. You could also use lastindexof for the latest completed hand.

 

 


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'Martin Carter – psxpoker.com Dim dir As String dir = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) 'this is the pokerstars default directory Dim MyHHpath As String = dir & "\PokerStars\HandHistory\" 'create the array to put all the directories in to search for HH files.
Dim DirList As New ArrayList 'get the subdirectories If (System.IO.Directory.Exists(dir & "\PokerStars\HandHistory")) Then GetDirectories(MyHHpath, DirList) 'this is a folder i also save HH files in DirList.Add(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString & "\HH") lstDirFile.Items.Clear() For Each x In DirList Dim files() As System.IO.FileInfo Dim dirinfo As New System.IO.DirectoryInfo(x.ToString) files = dirinfo.GetFiles("HH*Hold'em*.txt", IO.SearchOption.AllDirectories) For Each file In files 'skip the holdem omaha mixed games If file.ToString.Contains("Omaha") = True Then GoTo skipOmahaFile 'path and filename Dim FileN As String = dirinfo.ToString & "\" & file.ToString Dim filex As New FileInfo(FileN) sizeInBytes2 = filex.Length 'i use this to only add files modified today (ext.letfof is a function... ext.leftof("blah","ah") returns "bl" Dim Lastwrite As Date = eXt.LeftOf(filex.LastWriteTime, " ") 'add the size in bytes and filename to list a If Lastwrite = eXt.LeftOf(Now, " ") Then lstDirFile.Items.Add(sizeInBytes2.ToString & ", " & FileN) End If SkipOmahaFile: Next Next If lstDirFile.Items.Count = 0 Then Exit Sub Else ' populate list b from list a if its empty If lstDirFile2.Items.Count = 0 Then For i = 0 To lstDirFile.Items.Count - 1 lstDirFile2.Items.Add(lstDirFile.Items.Item(i)) Next Else 'start compare and refresh list here 'loop thru list a For i = 0 To lstDirFile.Items.Count - 1 'loop thru list b For x = 0 To lstDirFile2.Items.Count - 1 'If the 2 filenames are the same If eXt.RightOf(lstDirFile.Items.Item(i), ", ") = eXt.RightOf(lstDirFile2.Items.Item(x), ", ") Then 'if the sizes dont match then a hand has just completed If eXt.LeftOf(lstDirFile.Items.Item(i), ", ") <> eXt.LeftOf(lstDirFile2.Items.Item(x), ", ") Then 'here is the file that changed and it is read into memory Dim sr As New IO.StreamReader(eXt.RightOf(lstDirFile.Items(i), ", ").ToString) Dim Sr2 As String = sr.ReadToEnd 'your event would go here
End If End If Next Next 'now move the items from list a to list b for the next timer trigger to compare again lstDirFile2.Items.Clear() For i = 0 To lstDirFile.Items.Count - 1 lstDirFile2.Items.Add(lstDirFile.Items.Item(i)) Next End If End If End Sub

 

I collect 77 different data values from 9 players per hand and store that data on a list of 7000+ players. I parse about 2300 hands per minute on a laptop with this code. Don’t forget to handle exceptions.

1 Comment. Join the Conversation
   

30 million playchip hand on pokerstars

Posted July 2, 2013 By martin

30milhand

 

Pokerstars™ now has 50k/100k-play chip ring games. On weekdays they seat some  talented players(allot of post-black friday U.S. players) that can give some  good competition. “play chips”, these chips do have value, and they are resalable for up to 5 U.S. per mil. Great for club hosting or playing high stakes ring tables or tourneys. You can sit at a ring table with a 10 mil stack and I suggest starting the game with Tight Aggressive play until your HUD sorts out the bunch and you catch a hand. I have played a few on weekends and judging by the poor play,  Some of these players are surely buying their chips. Limping with trash with 5 to 6 people seeing the flop and 1 bet/3 call action on a garbage flop. Throw the buy out the window and be prepared for 2 or 3 calls of four times the big blind on your late position raise.  Come join the fun.

3 Comments so far. Join the Conversation
   

PSxP just moved here

Posted July 1, 2013 By martin

under-construction-sign

we just moved so please give me time to do some stuff.

wtehg wetrhgwhteg wethgwehy wethwteh wethwtehg ewthweth ewsrthwtehg te eryjheryh eryjh etyr jert yj treyj ery j etryj etry j eryjh ery je ryj etry jer yh gbrju rtny r 6yetn 6 hy juyh nj 57yt r6uj yth fj uynt j 45ytnh fd ju6 jyh rej u6 yh t  6jury hj u6 jmntyh h j6uy nt j6uj ytnh  y5tj r ytj t ujki7 6km yjnh  gko ,mgki jn  kgmj h  dhgfj hk m jnh bg dhfjgku  hugmgj fnhb gr try htujy ituy mki yjnhtbrg vtvry hturyit uyo mkiy jnthb rgv yhtu rjiytukm yjn htb rgh trnjy mku ytjn thbyg ry hbtu rnytmu yt knjthb r tmkyj nthb r ht njytmk jn thbr gv yhbnj ymk tn rthbr gv bhtj nytmk tjnthb rgv bht jny

weth

4 Comments so far. Join the Conversation
   

Evaluate a Poker Hand C#

Posted July 1, 2013 By martin
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FiveCardArray_CSharp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            string[] CardValues = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace" };
            string[] CardSuits = { "Hearts", "Spades", "Clubs", "Diamonds" };
            foreach (string value in CardValues)
            {
                ddlValue1.Items.Add(value);
                ddlValue2.Items.Add(value);
                ddlValue3.Items.Add(value);
                ddlValue4.Items.Add(value);
                ddlValue5.Items.Add(value);
            }
            foreach (string value in CardSuits)
            {
                ddlSuit1.Items.Add(value);
                ddlSuit2.Items.Add(value);
                ddlSuit3.Items.Add(value);
                ddlSuit4.Items.Add(value);
                ddlSuit5.Items.Add(value);
            }
        }
        private static int GetSuit(string DropDownSuit)
        {
            int retVal = 4;
            switch (DropDownSuit)
            {
                case "Clubs":
                    retVal = 0;
                    break;
                case "Diamonds":
                    retVal = 1;
                    break;
                case "Hearts":
                    retVal = 2;
                    break;
                case "Spades":
                    retVal = 3;
                    break;
            }
            return retVal;
        }
        private static int GetFace(string DropDownFace)
        {
            int retVal = 13;
            switch (DropDownFace)
            {
                case "Ace":
                    retVal = 0;
                    break;
                case "2":
                    retVal = 1;
                    break;
                case "3":
                    retVal = 2;
                    break;
                case "4":
                    retVal = 3;
                    break;
                case "5":
                    retVal = 4;
                    break;
                case "6":
                    retVal = 5;
                    break;
                case "7":
                    retVal = 6;
                    break;
                case "8":
                    retVal = 7;
                    break;
                case "9":
                    retVal = 8;
                    break;
                case "10":
                    retVal = 9;
                    break;
                case "Jack":
                    retVal = 10;
                    break;
                case "Queen":
                    retVal = 11;
                    break;
                case "King":
                    retVal = 12;
                    break;
            }
            return retVal;
        }
        private void btnGetHand_Click(object sender, EventArgs e)
        {
            if (ddlSuit1.Text == "" | ddlSuit2.Text == "" | ddlSuit3.Text == "" | ddlSuit4.Text == "" | ddlSuit5.Text == "" |
              ddlValue1.Text == "" | ddlValue2.Text == "" | ddlValue3.Text == "" | ddlValue4.Text == "" | ddlValue5.Text == "")
            {
                MessageBox.Show("All boxes need to have a value.");
            }
            else
            {
                lblHandDisplay.Text = CreateHand();
            }
        }
        private string CreateHand()
        {
            string retHand = "";
            int[,] hand = new int[3, 12];
            //1st Card
            hand[GetSuit(ddlSuit1.Text), GetFace(ddlValue1.Text)] = 1;
            //2nd Card
            hand[GetSuit(ddlSuit2.Text), GetFace(ddlValue2.Text)] = 1;
            //3rd Card
            hand[GetSuit(ddlSuit3.Text), GetFace(ddlValue3.Text)] = 1;
            //4th Card
            hand[GetSuit(ddlSuit4.Text), GetFace(ddlValue4.Text)] = 1;
            //5th Card
            hand[GetSuit(ddlSuit5.Text), GetFace(ddlValue5.Text)] = 1;
            if (IsFlush(hand) && IsStraight(hand))
            {
                retHand = "Straight Flush";
            }
            else if (IsFourOfAKind(hand))
            {
                retHand = "4 of a Kind";
            }
            else if (IsThreeOfAKind(hand) && IsPair(hand))
            {
                retHand = "Full House";
            }
            else if (IsFlush(hand))
            {
                retHand = "Flush";
            }
            else if (IsStraight(hand))
            {
                retHand = "Straight";
            }
            else if (IsThreeOfAKind(hand))
            {
                retHand = "3 of a Kind";
            }
            else if (IsTwoPair(hand))
            {
                retHand = "2 Pairs";
            }
            else if (IsPair(hand))
            {
                retHand = "a Pair";
            }
            else
            {
                retHand = "Nothing";
            }
            return retHand;
        }
        private bool IsFlush(int[,] hand)
        {
            bool retVal = false;
            int fCount = 0, x = 0, y = 0;
            do
            {
                if (hand[x, y] == 1)
                {
                    fCount++;
                }
                y++;
                if (fCount == 5)
                {
                    retVal = true;
                    break;
                }
                else if (fCount != 5 && y == 13 && x < 4)
                {
                    y = 0;
                    x++;
                    fCount = 0;
                }
                else if (fCount != 5 && y == 13 && x == 4)
                {
                    break;
                }
            }
            while (x < 4 && y < 13);
            return retVal;
        }
        private bool IsFourOfAKind(int[,] hand)
        {
            bool retVal = false;
            int fKCount = 0, x = 0, y = 0;
            do
            {
                do
                {
                    if (hand[x, y] == 1)
                    {
                        fKCount++;
                    }
                    x++;
                }
                while (fKCount < 5 && x < 4);
                if (fKCount == 4)
                {
                    retVal = true;
                    break;
                }
                else if (fKCount > 4)
                {
                    break;
                }
                else
                {
                    y++;
                    x = 0;
                    fKCount = 0;
                }
            }
            while (x < 4 && y < 13);
            return retVal;
        }
        private bool IsStraight(int[,] hand)
        {
            bool retVal = false;
            int sCount = 0, total = 0, x = 0, y = 0;
            do
            {
                total = 0;
                x = 0;
                do
                {
                    total = total + hand[x, y];
                    x++;
                }
                while (x < 4);
                if (total > 1)
                {
                    break;
                }
                else if (total == 1)
                {
                    sCount++;
                    if (sCount == 5)
                    {
                        retVal = true;
                        break;
                    }
                }
                else if (total == 0)
                {
                    sCount = 0;
                }
                y++;
            }
            while (y < 13);
            if (sCount == 5)
            {
                return retVal;
            }
            else
            {
                int Aces, Kings, Queens, Jacks, Tens;
                Aces = hand[0, 0] + hand[1, 0] + hand[2, 0] + hand[3, 0];
                Kings = hand[0, 12] + hand[1, 12] + hand[2, 12] + hand[3, 12];
                Queens = hand[0, 11] + hand[1, 11] + hand[2, 11] + hand[3, 11];
                Jacks = hand[0, 10] + hand[1, 10] + hand[2, 10] + hand[3, 10];
                Tens = hand[0, 9] + hand[1, 9] + hand[2, 9] + hand[3, 9];
                if (Aces + Kings + Queens + Jacks + Tens == 5)
                {
                    retVal = true;
                }
                return retVal;
            }
        }
        private bool IsThreeOfAKind(int[,] hand)
        {
            bool retVal = false;
            int x = 0, y = 0, tKCount = 0;
            do
            {
                do
                {
                    if (hand[x, y] == 1)
                    {
                        tKCount++;
                    }
                    x++;
                }
                while (tKCount < 4 && x < 4);
                if (tKCount == 3)
                {
                    retVal = true;
                    break;
                }
                else if (tKCount > 3)
                {
                    break;
                }
                else
                {
                    y++;
                    x = 0;
                    tKCount = 0;
                }
            }
            while (x < 4 && y < 13);
            return retVal;
        }
        private bool IsPair(int[,] hand)
        {
            bool retVal = false;
            int x = 0;
            int y = 0;
            int pCount = 0;
            do
            {
                do
                {
                    if (hand[x, y] == 1)
                    {
                        pCount = pCount + 1;
                    }
                    x = x + 1;
                }
                while (pCount < 3 && x < 4);
                if (pCount == 2)
                {
                    retVal = true;
                    break;
                }
                else if (pCount > 2 && y > 12)
                {
                    break;
                }
                else if (pCount <= 3)
                {
                    y++;
                    x = 0;
                    pCount = 0;
                }
            }
            while (x < 4 && y < 13);
            return retVal;
        }
        private bool IsTwoPair(int[,] hand)
        {
            bool retVal = false;
            int x = 0, y = 0, pCount = 0, p2Count = 0;
            do
            {
                do
                {
                    if (hand[x, y] == 1)
                    {
                        pCount++;
                    }
                    x++;
                }
                while (pCount < 3 && x < 4);
                if (pCount == 2)
                {
                    break;
                }
                else if (pCount > 2)
                {
                    break;
                }
                else
                {
                    y++;
                    x = 0;
                    pCount = 0;
                }
            }
            while (x < 4 && y < 13);
            y++;
            x = 0;
            if (pCount == 2)
            {
                do
                {
                    do
                    {
                        if (hand[x, y] == 1)
                        {
                            p2Count++;
                        }
                        x++;
                    }
                    while (p2Count < 3 && x < 4);
                    if (pCount == 2 && p2Count == 2)
                    {
                        retVal = true;
                        break;
                    }
                    else if (p2Count > 2)
                    {
                        break;
                    }
                    else
                    {
                        y++;
                        x = 0;
                        p2Count = 0;
                    }
                }
                while (x < 4 && y < 13);
                return retVal;
            }
            else
            {
                return retVal;
            }
        }
    }
}
1 Comment. Join the Conversation
   

Hit Counter provided by shuttle service from lax