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-nmm7 (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-nmm7 (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-nmm7 (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
Script Advice
Author Message
Catalan_mistral
Journeyman
*

Posts: 54
Likes Given: 2
Likes Received: 6 in 5 posts
Joined: Jan 2017
Reputation: 0



Post: #1
Script Advice
On another of my posts I asked for ideas of games for my compendium, someone suggested a script for poker, so i have started working out certain aspects needed for it, I have been able to either use or adapt parts of my blackjack script, and i'm currently working on a way to work out the best hand from any given amount of cards from 5 to 7.

My current way of doing it is a series of tags, and checks based on the tags. The clickable item, dealing the cards, sorting the cards and scoring the cards works out at about 350 lines of code, still a couple of things to snag on it atm.

Now the question is, is this a good way of scripting the scoring aspect using tags and checks, or is 8500+ lines of defs like I saw in the other poker script a better way in respect to speed and resources?

The One and Only......
02-21-2017 10:13 AM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #2
RE: Script Advice
If you are looking for best performance I think u should use MYsql db
03-10-2017 01:32 AM
Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #3
RE: Script Advice
If no web access is needed, sqlite is a better choice then mysql

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
03-10-2017 09:28 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Ben's post
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #4
RE: Script Advice
sphere already have its own LIST function to create "virtual" arrays with basic functions like insert/remove/sort values, if you just need some simple storage maybe it will work. But honestly I never used it so I don't know if its safe to use on scenarios like 8500 lines loop

as Ben said, if you need something local and a bit more complex you can use sphere internal SQLite engine. Or if you need something even more complex you can install an MySQL server to use advanced SQL commands, create more SQL users, access it remotely, etc
03-11-2017 01:01 PM
Find all posts by this user Like Post Quote this message in a reply
Catalan_mistral
Journeyman
*

Posts: 54
Likes Given: 2
Likes Received: 6 in 5 posts
Joined: Jan 2017
Reputation: 0



Post: #5
RE: Script Advice
basically the script I have checks how many of each suit, how many of each value card on initial deal, then does a few checks and works out the best hand you have using 20 IF statements, so I wanted to see if that was a good way of doing it, or writing 8500 lines of definitions for possible hands in poker like I saw on another poker script Smile

The One and Only......
03-11-2017 08:12 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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