|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
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] Newbie question and two comments
Hey all this is my first time participating in the contest, it looks interesting. I'm mainly wondering if I can use someone else's code as part of my submission. Obviously I'd have to make modifications to make it fit into the contest and I'll keep copyright notices... but is it kosher?
I only wish I had found out about these contests sooner... I would have LOVED to create my own AI for Risk, but hopefully that contest will run again (maybe with a different map?). Also if you're looking for ideas for future contests, I would suggest a simplified game of "Axis and Allies". You can email me for more details, but it is similar to Risk except: - Units have different strengths / abilities - There are always five countries per game - Each country starts with fixed locations - It is team-based with 3 allies v. 2 axis |
|
#2
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Quote:
Hey, as long as we're using other people's code, mind if I use yours? |
|
#3
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Well, we can't stop you from taking other's code, but since you're the one competing in this contest, it should be your code.
|
|
#4
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Quote:
It's kind of soon for that right now I think |
|
#5
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Quote:
I agree. The problem with blackjack is that there is no real clever game winning algorithm that one can use. It is a game of chance; all you do is come up with a playing strategy and apply a whole lot of logical (if-else) statements. A contest that test one's algorithmic ability would be more interesting, dont you think? |
|
#6
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
It would to some, but not to others. Not everyone has a computer science background, and me and Matt thought it was time for something easier
|
|
#7
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Not enough computer science background? Something easy? I must be putting too much work into mine
|
|
#8
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
lol yeah i guess they teach discrete mathematics to grade schoolers now
|
|
#9
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Well, that's exactly the point. Anyone can write a script that can play a solid game, yet playing perfectly is quite hard, given the time constraints, so it should be interesting to everyone
|
|
#10
|
||||
|
||||
|
[Blackjack] RE: Newbie question and two comments
Quote:
Yeah, that's why I wondered about using someone else's code. There's a statistics package available through PEAR that I think would help out a lot for this project. (Oops, did I just let the cat out of the bag? Quote:
You're more than welcome to it when the contest is over :p |
|
#11
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Quote:
Unfortunatly the difference between a perfect script and a pretty good one would not be noticeable in this contest without playing lots and lots of games, as there's simply too much luck involved. However, it's still interesting to code (I think), and the good thing about this one is you can put as little or as much time into it as you want... who knows, you might get lucky |
|
#12
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Quote:
Actually, the scripts will all get identical input. The difference between a perfect script and a pretty good one may be only a few dollars, but that'll still be enough to get you a copy of Zend Studio and a few books ;-) |
|
#13
|
||||
|
||||
|
[Blackjack] RE: RE: Newbie question and two comments
Quote:
Not quite true. A perfect script would be one that correctly assessed the probabilities of winning at each point and bet/acted accordingly. However doing the 'wrong' thing can sometimes work. For example hitting on 20 can occasionally win, even though it's stupid. As you get closer to perfection the number of hands needed to differentiate between two scripts grows larger and larger, I haven't done the maths but I suspect that the number of hands needed to differentiate between perfection and just short is going to be something ridiculous. |
|
#14
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
Actually it's even worse
If you stand, you'll get different cards on following hands than if you hit, regardless of whether you win or lose the current hand. So, if you knew what the cards are, it would be better in some cases to intentionally hit on 20, even if you knew you're going to lose, because you'd get better cards in, say, next 6 hands... Still, a better script will IMHO win, regardless of luck. If 160 games are played with average 5 decks, that's around 7500 hands, which should be enough... Maybe I'll take the top 5 scripts to another round of 500 games or something, if time permits... |
|
#15
|
|||
|
|||
|
[Blackjack] RE: Newbie question and two comments
And that really is the crux of the matter. You might write the perfect script that works out the precise probabilities and plays mathematically, computer-perfect, wonderous blackjack. You might spend the next week reading up on basic strategy, buying blackjack books and testing your code over 30,000,000,000 hands. And you might lose to a guy who has just written PlayHit() in a loop with stakes set to the maximum bet. And yes, that does happen in real casinos too.
That's why from a computer science/mathematics background, you might not have an edge. In fact, to do some very clever maths, you might actually hit the 60 seconds limit, in which case, you end up a loser. I know last night on my 400 MHz Celeron laptop running FreeBSD (you may laugh, but the battery lasts 6 hours and it cost me 200 quid), I tried one algorithm that hit the 60 second limit. My tip, having read the rules a few times and thought about this from a game strategy is simple: don't let sloppy coding lose you bets by trying to double when you can't, or somesuch. Write tight, decent code, and hope that it comes right for you. ;-) P.S. - this is my first post as a registered user. Woo-yay, etc. Oh no, that's the other place... |
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > [Blackjack] Newbie question and two comments |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|