Need assistance fixing a contain text for my black jack game

I need this code to check what number the image that is being used has in it so that it can add it to the total value of your cards. The number goes up to 13 because Jacks = 11, Queen = 12, King = 13.

You need to build a two column table (list of lists), with card image file names in column 1 and their values in column 2, as a global init.

Then do a lookup in pairs for each card in your hand, card by card, summing as you go.

I don't expect you to have 13 cards in your hand in Blackjack.

By the way, isn't there also a special rule for Aces, where you can choose 1 or 11?

BlackJack.aia (2.5 MB)
I don't think that applies with my code but correct me if I'm wrong and about the aces yes there is but that is a later problem lol.

I looked in your Media folder, and you have a very good card Picture file naming scheme, where the card value precedes "OfSuit". That could be used to get the card value directly from the Picture name if you split it at "Of" and take item 1 of the resulting list.

But I don't see any Aces there.
(Never mind, i see them now.)

the aces are 1 for convenience of a situation like this

I have no idea what to do from here lol

should be

for starters.

Also, use the Companion and Do It for debugging.

I was using companion I was to dumb to see that lol

Thanks for helping out

Here's a draggable present for you:
card values