# Gogo 21 Python optimal solution (Blackjack style)

I need a python script that will produce the optimal solution for a game called GoGo 21 that is based on BlackJack rules. Please see picture in attach.

SCRIPT NEEDS

The script will receive in input a list of 52 cards. The taxonomy is 2-3-4-5-6-7-8-9-10-J-Q-K-A.

The script needs to return in output a list with the sequence of where to put each card (column1, column2, column3, column4 or trash).

Please read carefully the game rules and point calculation. I want a script that produce the optimal solution to solve for the highest score based on the points calculation rules below.

DELIVERY

I am a Python developer so I know how to read and write code, I just don't have time do to this.

1- CODE NEEDS TO BE WELL INDENTED AND COMMENTED

2- CODE WILL BE PLUGGED IN INTO ANOTHER SCRIPT

3- THE SOLVE FOR THE BEST SCORE PART WILL BE EXTENSIVELY TESTED

GAME RULES

The goal is to place (or throw away) all 52 cards in the deck in one of the four columns on the card table to complete the round. You can only place or throw away one card at a time. The current card you have to place is the 'open' or card lying face up under the four columns. To the left of the deck you can see how many cards remain to be placed.

You can place each card in any column as long as the sum does not exceed 21; the sum of the column is presented above each column. When the column adds up to 21 the column will be cleared and you will receive points depending on the card combination you used. Columns where you can’t place the card will be dimmed down. If you can’t place the card you have to throw it away by clicking the trash can to the right of the deck. Try to keep the number of cards you throw away to a minimum, so you get a bigger bonus at the end of the round.

Just like in Black Jack an Ace can be worth 1 or 11, and the game automatically picks the suitable value trying to add up to 21 when possible. The Jacks, Queens and Kings are worth 10 and the other number cards are worth their face value.

There are 4 ways of combining cards to clear a column:

Standard 21: Any number of cards that add up to 21

Black Jack: You combine an Ace with any card worth 10

5 Card Charlie: 5 cards where the sum of the cards adds up to less than 21

Joker: The Joker will clear any column regardless of the value

The different combinations have different scoring values.

Points calculation:

The base score for clearing a column starts at 100 points, and after that each time you clear a column it’s worth an additional 100 points. So the second time you clear a column it has a base score of 200 points and so on. Then for a Black Jack or a 5 Card Charlie combination you get an additional bonus on top of your base score. A Black Jack gives you additional points equal to the base score for that column being cleared, and a 5 Card Charlie gives you extra points equal to double the base score. Here’s an example of a series of cleared columns and their scores:

Clearing Type Base score Add on Total value

1 21 100 0 100

2 21 200 0 200

3 21 300 0 300

4 Black Jack 400 400 800

5 21 500 0 500

6 5 Card Charlie 600 1200 1800

7 Black Jack 700 700 1400

8 21 800 0 800

and so on.

( 4 reviews ) London, Switzerland

Projektin tunnus: #15389596

## 10 freelanceria on tarjonnut keskimäärin 156 \$ tähän työhön

i8solutions

when do you need this? Relevant Skills and Experience python django Proposed Milestones \$177 USD - milestone

177 \$ USD 3 päivässä
(4 arvostelua)
5.0
Valuesolutions

Hello, how are you? I have read the details provided, but please contact me so that we can discuss more on the project. I don't outsource like most people do ensuring quality work on time Relevant Skills and Experien Lisää

147 \$ USD 3 päivässä
(17 arvostelua)
4.8
155 \$ USD 3 päivässä
(2 arvostelua)
3.7
lnarayanan90

To view my primary work profile [url removed, login to view] Have created algorithms exclusively with python. Relevant Skills and Experience pyth Lisää

180 \$ USD 6 päivässä
(7 arvostelua)
4.0
travisyates31

Thank you for your project. Relevant Skills and Experience I want to meet you Proposed Milestones \$350 USD - Good job

350 \$ USD 10 päivässä
(10 arvostelua)
3.6
155 \$ USD 3 päivässä
(0 arvostelua)
0.0
111 \$ USD 3 päivässä
(0 arvostelua)
0.0
ITexpert06

Hello, I am expert in python, php ,HTML and data mining, I have 7 years+ experience in data mining, website scraping, screen scraping and I am certified as python expert. I have completed 100+ projects in python-- for Lisää

30 \$ USD 3 päivässä
(0 arvostelua)
0.0
MagicCoder07

Hi, I have gone check your projects descriptions so I can do it perfectly. I have 9 years+ experience in Software architecture, Coding, Programming, Python, Java. I have completed lot of projects with Python, Script w Lisää

100 \$ USD 5 päivässä
(0 arvostelua)
0.0
155 \$ USD 3 päivässä
(0 arvostelua)
0.0