Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Poker Functions (https://forums.graalonline.com/forums/showthread.php?t=83452)

Chompy 01-01-2009 08:02 PM

Poker Functions
 
1 Attachment(s)
Well, haven't released something for a long time, so I guess it's time again?

I did have a little problem using the original pokereval() function for my poker game, so I decided I had to make my own! :D

Anyways, here's some examples of usage:

PHP Code:

function onCreated() {
  
join("pokerfunctions");
  
  
temp.table = {
    
"spades_ace", "spades_king", "spades_jack",
    
"diamonds_2", "hearts_7"
  
};
  
  
temp.player1 = {"spades_queen", "spades_10"};
  
temp.player2 = {"spades_3", "spades_7"};
  
  
temp.eval1 = pokereval(table, player1); // royalflush,A
  
temp.eval2 = pokereval(table, player2); // flush,"A,K,J,7,3"
  
  //Lets find the winner? Eh?
  
  
echo(printableWinnerOutput({eval1, eval2})); // Winner is: Player 1 with a royalflush
} 

PHP Code:

function onCreated() {
  
join("pokerfunctions");
  
  
temp.table = {
    
"spades_ace", "diamonds_king", "hearts_10", "diamonds_3",
    
"spades_4"
  
};

  
temp.player1 = {"hearts_2", "spades_7"};
  
temp.player2 = {"spades_jack", "diamonds_queen"};
  
  
temp.eval1 = pokereval(table, player1); // highcard,7
  
temp.eval2 = pokereval(table, player2); // straight,A
  
  //Lets find the winner? Eh?

  
  
echo(printableWinnerOutput({eval1, eval2})); // Winner is: Player 2 with a straight
} 


( If you need help or a better description of one of the functions, just say so in a post below or by PMing me)

Script: Attachment 46966


Changelog:

1.0: - Initial release

Soala 01-01-2009 08:38 PM

Looks neat to me =P

Devenio 01-01-2009 10:54 PM

Yay 4 Chompy (Alex)!!!!!

Neat work :D keep it coming!!!

cbk1994 01-01-2009 10:59 PM

Very cool!

Dan 01-02-2009 01:18 AM

Impressive :)

Pelikano 01-02-2009 03:16 PM

There are in built poker functions...?

xD

Deas_Voice 01-02-2009 03:36 PM

nice.


All times are GMT +2. The time now is 06:53 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.