The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need a more efficient function
Author Message
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #5
RE: I need a more efficient function
Just a few questions, is LIST global or local? Does it get erased after the game is aquitted? If not, you should think of storing your LIST as a TAG on the game holder, have it stored like an array sorted by commas to retrieve and organize it all. I would suggest CTAG but it is online only, and sometimes players have connection issues.

You could probably sort your tags out (in a similar fashion) on the table masters/game hosts character as:

tag.poker.cardlist //cards to be played (all 52 shuffled at the beginning of the hand)
tag.poker.hand //current hand (to be organized as posted above)

The idea of LIST looks bulky to me, especially considering a gameserver can populate very high. With a couple tags, storing the info as an array, you can erase these after the game ends. Maybe it'll help, not sure.

Your code above looks optimized, loops are always a bit of a ram chug but it's the only way you can sort your hands, seeing that poker will have 5 cards to sort out between all players won't show much of a problem in my opinion... it looks alright.

An easy way to know how to sort your cards (by #), go to the store, pickup a fresh pack of cards for $1. Start counting them out, that'll give you a numbered list and an proper array to sort out Smile

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
07-11-2012 08:33 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RE: I need a more efficient function - Skul - 07-11-2012 08:33 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)