Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-15-2005, 08:10 PM
donger donger is offline
Junior Member
 
Join Date: Apr 2004
Posts: 5
Default a little perl help, please

Hi,
I'm working on fixing the bisonbison converter so that it works with the new absolute hand history format. Right now, everything is working except you have to reorder the seat numbers numerically before pasting in the hand:

Seat 6 - DAWGNWNUTS69 ($196 in chips)
Seat 7 - JERKSTORE ($181.50 in chips)
Seat 9 - NEOND ($104 in chips)
Seat 5 - STANSFIELD ($49 in chips)

has to become:

Seat 5 - STANSFIELD ($49 in chips)
Seat 6 - DAWGNWNUTS69 ($196 in chips)
Seat 7 - JERKSTORE ($181.50 in chips)
Seat 9 - NEOND ($104 in chips)

in order for the converter to work.

I was wondering if someone could help me write the piece of code to sort this $Players object by the PlayerSeatNumber property?

Here's the relevant code where the object is filled:

<font class="small">Code:</font><hr /><pre>
while ($Message =~ s/Seat (\d+) - (.*?) \(((\$)?\d+(\.\d+)?) in chips\)//)
{
$Players{"$j"}-&gt;{"PlayerSeatNumber"} = $1;
$Players{"$j"}-&gt;{"PlayerName"} = $2;
$Players{"$j"}-&gt;{"PlayerStack"} = $3;

###SORT $Players here so the following code doesn't break

#name the seats, starting at the button
if ($Players{"$j"}-&gt;{"PlayerSeatNumber"} == $SeatButton)
{
$Players{"$j"}-&gt;{"PlayerTitle"} = "Button";
$Players{"$j"}-&gt;{"PlayerTitleDisplay"} = "Button";
}
elsif (($Players{"$j"}-&gt;{"PlayerSeatNumber"} &gt; $SeatButton) &amp;&amp; ($j &lt;= $PlayerCount))
{
$Players{"$j"}-&gt;{"PlayerTitle"} = pop @SeatTitleList;
$Players{"$j"}-&gt;{"PlayerTitleDisplay"} = pop @SeatTitleDisplayList;

}
$j++;
}
</pre><hr />



THANKS!
donger
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.