21 Points


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Python3

In this task, you are required to be the judge of a 21 point poker game.

The rules of the game is simple, two players each have a maximum of 5 poker cards, this includes 4 suites:

Heart
Diamonds
Club
Spade

The actual cards:

Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King

In the 21 point game we don't count the Jokers.

For simplicity, Ace counts as 11 points; Jack, Queen, King count as 10 points.

Two players will show you their cards.

If both players have the same points, it's a tie.
If both players have above 21 points, it's a tie.
If one player has 21 points, he/she wins.
If one player has more than 21 points, he/she loses, unless the other player also has above 21 points, in which case it's a tie.
If both players have less than 21 points, the player closer to 21 wins.

Input Specification

The first line will contain the cards of player Tom, second line Jerry's. Each card is noted by first the suite, then underscore, then the number.

E.g. ace of spade is given as Spade_Ace, 10 of diamonds is Diamonds_10.

Output Specification

Name of the winner, Tom or Jerry or It's a tie!

Sample Input 1

Spade_Ace Diamonds_King
Club_10 Heart_Jack

Sample Output 1

Tom

Comments

There are no comments at the moment.