ok i missed A was worth 1β¦
Sorry everything works !
100% !!!
yeah i got it in c sharp ! 100% good puzzle !
My favourite Puzzle so far!
even tho my code is quite longβ¦
Ahh, thank you so much. You made my day !!
Hello!
I donβt understand test #6.
3 β2β were played, and 18 cards >= β3β were played.
So it left one chance on 31 cards, so 3%, not 10%.
What have I misunderstood ?
Thanks
Hi,
Aces have a value of 1, so it left 3 chances out of 31 cards.
Aaah, forgot this.
All green, thanks
I have used an exemption on Test 9 because I thought it didnβt calculate it correctly, now I think there is either an error with the expected answer or the way binary is rounded in Python 3.
My code scores correctly all other cases (both in testing and evaluating) but it gets Test 9 wrong, tried to manipulate it in the formula, but when I do that all other Tests go wrong. Anyway Test 9 should be 7% but it is 8% so this what I had to do in the code:
serials = list(stream_of_consciousness.split(β.β))
cards = set({βAβ, β2β, β3β, β4β, β5β, β6β, β7β, β8β, β9β, βTβ, βJβ, βQβ, βKβ})
deck = [f"{item}" for item in cards]*4
for i in range(len(serials)):
# Check if the i-th string contains only card names
for char in serials[i]:
if char in cards:
continue
else:
serials[i] = β0β
break
# Turn the value of the cards sequence into sum of points
temp = []
for char in serials[i]:
if char in {βTβ, βJβ, βQβ, βKβ}:
temp.append(10)
elif char==βAβ:
temp.append(1)
else:
temp.append(int(char))
# Remove the card counted from the deck
if char!=β0β:
deck.remove(char)
remaining = []
for i in range(len(deck)):
if deck[i] in {βTβ, βJβ, βQβ, βKβ}:
remaining.append(10)
elif deck[i]==βAβ:
remaining.append(1)
else:
remaining.append(int(deck[i]))
PC = 0
for i in range(len(remaining)):
if remaining[i]>=bust_threshold:
PC+=1
PC = int(100*(1-PC/len(remaining)) + 0.5)
if round(PC)!=7:
print(str(round(PC)) + β%β)
else:
print(β8%β) # because Test 9 is bugged
Please edit your message and format your code using the </> button in the formatting toolbar, otherwise itβs difficult to read it. Thanks.
Hi,
The result for Test 9 is 3/40 so 7.5%, you just need to make sure that when you have a X.5, in order to get the βnearest whole numberβ you are rounding up.
I got distracted reading through the thoughts, then I realized I was trying to program a solution haha - good one
Nice little puzzle, very kind of you setting A fixed to 1 ;D
Just out from interest, does some1 have a βfancierβ solution to set up our knowledge of a Blackjack 52-cards deck? I am doing it like this currently (typescript):
const set = ['2', '3', '4', '5', '6', '7', '8', '9', 'A', 'T', 'J', 'Q', 'K'];
const deck = [...set, ...set, ...set, ...set];
Hi. Seems I have problem with filtering card streams and distraction. Used replace ^2-9AKJTQ and removal of uppercase followed by lowercase characters, but still below 50% of successful tests. Any advice?
THX
One of your thoughts might be JACK, because youβre thinking about your friend Jack but that doesnβt mean that youβve seen a jack and ace
Does that help?
well - it helped but caused a lot of thinking . Thank you!