|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
[Blackjack] How many games?
How many games will there be in the judging? I ask because I'm finding that I'm needing a lot of games to get a reasonably accurate measure of whether a change is an improvement or not, i.e. 100+. If a lot of people are getting near the 60s per game mark then judging could take a very long time. Admittedly I seem to be averaging about 0.1s per game so it may not be a problem.
Ben Hague |
|
#2
|
|||
|
|||
|
[Blackjack] RE: How many games?
Most probably it will be 160 games - each combination of rules possible (except maxbet). If the scripts are mostly very slow, though, it will be less. Can't waste too much server time ;)
|
|
#3
|
|||
|
|||
|
[Blackjack] RE: How many games?
In that case, I might just as well send in miniplay.php (with my own bestval function, of course). In just 160 games, it has as good a chance as a 'more intelligent' script, because results WILL vary depending on the composition of the deck. My script averages a positive result, but in a random game, it may lose 700 bucks. If the assignment were to program a script that produced the best result for a given deck, scoring them like you said would be acceptable. IMHO the assignment is to program a script that will have the best advantage on the house. You'd need to score at least 1000 decks (random rules) to assess this. I understand that a maximum execution time of 60 secs does not allow this, but scoring less decks has too big a chance for a single strategy to luck out.
|
|
#4
|
|||
|
|||
|
[Blackjack] RE: How many games?
Well, I don't think miniplay.php will do as well as possible.. We'll see
|
|
#5
|
|||
|
|||
|
[Blackjack] RE: How many games?
Just to be sure...i'd have to change GameStart() to StartGame, right?
|
|
#6
|
|||
|
|||
|
[Blackjack] RE: How many games?
What the rules say
(StartGame) |
|
#7
|
|||
|
|||
|
[Blackjack] RE: How many games?
Ok, this is somewhat on topic... I was wondering if there's an easy way to have the script play multiple games at once. Right now when it's done it does exit() which kills everything. Is there some way to have it keep going or restart without making major changes to the library? Thanks.
Edit: Never mind, I think I can figure it out. Replacing exit() with a function that restarts the game. |
|
#8
|
|||||
|
|||||
|
[Blackjack] RE: How many games?
Here's what I did: I made the lib into a class named blackjack. Instead of calling exit, I created a function named GameExit that records the final gamestate into a class variable named __finalstate. It also sets the boolean class variable GameEnd.
now I can run 10.000 games like this: php Code:
Don't forget to put '$this->' before all variable names in the original script. Of course, my script is a lot more complex, and I could let you in on all the details, but then I'd have to kill you. ;) |
|
#9
|
|||
|
|||
|
[Blackjack] RE: How many games?
Haha. I actually did figure it out last night. Didn't make a class like you did, but the idea is similar in terms of the for() loop and function call instead of exit(). Thanks anyway
|
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > [Blackjack] How many games? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|