Ostronkex / 100-Days-of-Code-The-Complete-Python-Pro-Bootcamp-Solutions

My solutions for the tasks over at 100 Days of Code: The Complete Python Pro Bootcamp by Angela Yu
MIT License
0 stars 0 forks source link

[Day 11] - Add ASCII-art for cards in hand #17

Open Ostronkex opened 2 months ago

Ostronkex commented 2 months ago

https://github.com/Ostronkex/100-Days-of-Code-The-Complete-Python-Pro-Bootcamp-Solutions/blob/365516a4a0ec5929afa7ba8e7377a437fb054776/Day11/Blackjack.py#L164

Add ASCII-art as a placeholder for the cards in hand instead of numbers for a prettier experience.

Ostronkex commented 2 months ago

I started on this but didn't know how I'd solve the counting part

I could change the cards_values list to unique values such as H2, H3 etc and grab that index and input that index into a print statement that prints the corresponding ASCII-card. However this means there is no value to count the total with. How do I assign a value to either the ASCII art or the H2, H3, H4 etc?

I received a suggestion to remove the letter from H2, H3 by using .remove[0] leaving just the value. For J D (Queen) K A, I would make a dictionary storing the letters and values as key:value pairs. Calling these values when counting made my head spin so I gave up for now. Will return to this in the future if a simpler solution presents itself.