Python Forum
BlackJack with tkinter
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BlackJack with tkinter
#5
(Sep-06-2022, 05:15 PM)menator01 Wrote: Can't seem to get the ace to do correct.

Yes, that was a tricky one to solve for me, also.

What I did was to have a function that assigns a value of eleven to a Ace card (in fact it assigns values to any card), then, when checking the 'hand', I take a note of how many Ace cards are held, and if the total hand is greater than 21, reduce the hand value by 10 for each Ace card held. Of course, there needs to be some code that only does that in order to try and beat the hand of the other player.

Not sure of that makes any sense to you: it's always clear to the person that's doing the explaining.
menator01 likes this post
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
BlackJack with tkinter - by menator01 - Sep-05-2022, 05:06 AM
RE: BlackJack with tkinter - by rob101 - Sep-06-2022, 01:14 PM
RE: BlackJack with tkinter - by menator01 - Sep-06-2022, 05:15 PM
RE: BlackJack with tkinter - by rob101 - Sep-06-2022, 05:29 PM
RE: BlackJack with tkinter - by rob101 - Sep-06-2022, 06:01 PM
RE: BlackJack with tkinter - by menator01 - Sep-06-2022, 07:01 PM
RE: BlackJack with tkinter - by ndc85430 - Sep-11-2022, 08:07 AM
RE: BlackJack with tkinter - by menator01 - Sep-11-2022, 08:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Blackjack (21) with Python BlazingWarlord 0 2,367 May-29-2021, 05:07 AM
Last Post: BlazingWarlord

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020