Man I hate this challenge...
I wrote a program to play for me, but my connection to Rankk keeps timing out (I don't have a very reliable internet connection, and the rankk server seems kinda slow.), so I never get to finish my 30 min of play time.
Also, there's not very much info in the rules... For example, there's no indication of whether or not the house has to hit on soft 17. (I suspect not since it seems that the house *refuses* to hit once it has reached 17, even if the player is at 18... very wierd). Not only that, but it seems as if the game is using randomization with replacement, which makes card counting impossible (unless you are using multiple decks and just haven't made that clear). All in all, it's just a lot of non-standard behavior that isn't very well laid out (laid out at all, I should say) in the rules.
In any event, my program makes a consistent profit... the most frustrating thing right now is just the constant time-outs that prevent it from finishing.
EDIT: Oh, and btw... I really like the new drop-down menu you got going up top there. :D
You're right. The inconsistency arises when the dealer has an Ace. I've fixed that so that the dealer will not "hit" when it reaches a minimum of 17. Note the special combinations for the dealer (and the player):
1) blackjack consisting of an ace and any 10
2) charlie consisting of 5 cards with points less than or equal to 21
3) double aces (same behaviour as blackjack)
Both dealer and player can only hit up to 5 cards.
Note that it's possible to still beat the challenge despite the inconsistency ;)
As for the drop-down menu, we like it to too ;) It's more versatile than the previous implementation.
Cheers,
Regarding the server's response time, the time of day can matter a lot.
Avoid buisness hours in ... Egypt ;-D
Reworked the logic for the dealer because the earlies fixes didn't work on at least one case when there's an Ace.
I've played it quite a number of times and the results have been consistent. Here're a few examples (for the dealer):
10, 5, A
- possible points 16, 26
- Hit since one outcome is below 17
2, 5, A
- possible points 8, 18
- Stand since one outcome is 17 or above
6, A
- possible points 7, 17
- Stand since one outcome is 17 or above
I'm not exactly sure what the rules in the casino are...can anyone verify?
You may want to take this with a grain of salt, since I've never actually been inside a casino, but as I understand things from reading the article on Wikipedia and reviewing it's sources:
1) If the dealer is below 17, he hits. (hard or soft, it doesn't matter)
2) If the dealer has 17 points or more, he stands. (hard or soft, it doesn't matter)
3) There is a possible rule variation to rule number #2: If the dealer has a soft 17, he hits. (must be soft 17 exactly, he still stands on soft 18 and above, and he still stands on hard 17 and above.)
Whether or not you use this variation, you are still using "casino rules"... Most casinos do *not* use this variation. However, most casinos *in Vegas* do use it. In my first post, I wasn't suggesting that one way or the other was correct, I was just wondering what the behavior was since you didn't specify which one you had chosen on the rules page. If you use this variation, and have the dealer hit on soft 17, you increase the house advantage over the player.
4) Other things you don't mention in the rules, are how shuffeling works, and how many decks you're using.
It seems right now like you haven't even thought about number of decks, and are just using randomization with replacement... ie. as soon as a hand is over, all the cards used for that hand are still in the pool of possible random choices, so it's possible you can get the same card two hands in a row. (I did some testing and found I got two of the same cards only 3 hands apart... so nowhere close to a full deck had gone by). That makes card counting impossible, and without card counting, the house still has the advantage... to quote Wikipedia: "basic strategy reduces the house advantage to less than one percent. Card counting typically gives the player an advantage of 0.5 to 1.5% over the house."
As of now, (unless I'm mistaken) you're basically using 1 deck, and shuffling the cards after every hand. In casinos, I think the number of decks used is dependant on the type of game. A "shoe" game would use 4 or more decks (up to 8), where as a hand-held "pitch" game would only use 1 or 2 decks.
As far as shuffleing goes, I don't think it's normally done after every hand (since that makes card counting impossible, and there are professional card counters who count cards for a living... they couldn't do that if the casinos shuffled after every hand). In shoe games, the shoe might be an automatic card shuffler. If so, the multiple decks inside would be continuously shuffled... however, in hand-held games, shuffling the deck after every hand would be time consuming, and very unlikely I think.
Regardless of the behavior you choose for number of decks and frequency of shuffling, I think it's important info that should be made available on the rules page.
Anyway, the fact that card counting isn't currently possible, and therefore the house has the advantage, makes me think there's something more to the challenge than just playing blackjack...
I see...I have played blackjack in a casino...but while I know the rules as a player, I don't know what the exact rules are for the dealer, particularly when there's an Ace in the combination. Maybe you could help me with the following two cases for the dealer:
i) 6 and A (17 or 7)
- Stand??
ii) 10, 5, A (16 or 26)
- Stand or Hit??
iii) 7, 4, A
- 21 or 22 points?
As for how many decks are used, when you click the challenge, it asks you to inspect the deck of cards...there's only one deck for inspection, so only one deck is used.
i) 6 and A (17 or 7)
- Stand??
This one depends on whether or not you are using the variation I mentioned above in #3... either hit or stand is correct, you just have to pick one. Most casinos in the U.S. and around the world have the dealer stand in this situation. Most casinos in Vegas have the dealer hit.
If the dealer stands, the player has a greater chance of winning.
ii) 10, 5, A (16 or 26)
- Stand or Hit??
26 is a bust, so it's not 16 or 26... it's just 16. Since 16 is lower than 17, the dealer hits. Always.
Ok, thanks ;)
I think I'm on the right track then as far as the logic for the dealer is concerned.
I edited to add a third case:
iii) 7, 4, A
Does that count as 21 or 22? From the rules I've read, A is either 1 or 11, never 10. So I'm inclined to count it as 22 (bust) or 12, in which case the dealer will Hit.
Aces are always counted as 11, unless that causes the player to bust. If it causes the player to bust, then it's counted as a 1.
7, 4, A
since 7 + 4 = 11, adding another 11 would equal 22 and cause the player to bust, therefore the ace is counted as 1, bringing the total up to 12. If the dealer had that hand (7, 4, A) then he would have to hit, since 12 is less than 17.
About a week and a half ago I accidentally wiped out my rankk folder with all the little scripts I had written to help solve the challenges, and my blackjack script along with the rest. So I haven't been working on this one (or any of the harder ones) for a while now.
Today though, I decided to start re-writing things, so I got a blackjack script going again. It scrapes credit and time info from the page after every hand. Its last output:
Credits: 1000 Time: 29
And yet I didn't pass the challenge *sniffle*
It's probably a bug in my program somewhere, but man it was such a bummer to see the challenge in purple still.
At least I figured out the trick to beating it though :) I'd never been able to get that close before today. I just have some bug hunting to do I guess.
EDIT: Anyway... I looked through my program and made it less retarded. Now I can get to 1000 a lot faster.
Credits: 1000 Time: 9
Still no luck passing the challenge though. I still can't figure out where I'm going wrong.
EDIT 2: I passed it now. Yay! :D
I didn't change anything with my program though, just ran it again... wierd. I think maybe it was cause I was having my program stop once it got to 1000 points, since the instructions say "You need 1000 or more credits to win" but you actually need more than 1000, and I got lucky and got a pay off of 3-1 on the last hand bumping me up over 1000... just a guess, I don't really know. Either that or I've got some kind of really wierd bug in my script.
Thanks!
And no, I don't hate any more... like it now. :) lol
:-O
Fixed a bug that reset the credits to 0.
*waves to Sapr0
Update: Improved the logic in situations where the player gets a blackjack or a double aces. Previsouly, the dealer hit until he got the maximum points or bust - so he may have 2 or more cards. Now, if the players gets a blackjack, the dealer's card and points are unchanged i.e. dealer only has one card.