Kapalı

Write a Python program that accepts stacks of balls

Write a Python program that accepts stacks of balls as input, conducts a Uniform-Cost Graph Search, and displays a solution as shown in the following example.

The program should output “No solution” when a given puzzle cannot be solved.

Ball Sort Puzzle: We have 16 balls. Each ball is labeled by either A, B, C, or D. We also have 6 stacks. Each stack can contain 4 balls. The 16 balls are randomly placed in 4 stacks. Two stacks are left empty. The goal of this puzzle is to sort the balls by label, so that 4 non-empty stacks contain 4 balls of the same label. There are two restrictions:

1. Only the top ball of each stack can be moved, and

2. A ball can only be placed on top of another ball of the same label or in an empty stack.

The following figure shows an example of the ball sort puzzle with an initial state and a possible goal state. Note that given an initial state, there may be multiple goal states.

Here are additional information

1) Your program must accept four lines of input using Python input() function. The first line is the top of the four stacks, the second line is the second element of the four stacks, etc. For example, the following input shows an initial state that is also a goal state.

A B C D

A B C D

A B C D

A B C D

2) Your program does not need to validate the input values. You can assume that the input values contain 4 As, 4 Bs, 4 Cs, and 4 Ds arranged in random order placed is the first four stacks.

Beceriler: Yapay Zeka, Python, Machine Learning (ML)

Daha fazlasını gör: write program accepts purchase amount calculates discounted price, write a python program which accepts the radius of a circle from the user and compute the area., write a python program to calculate the simple interest and compound interest, write a program in python that computes the interest accrued on an account, write a python program to count the number of lines in a text file., write a python program to read an entire text file, write a program to solve travelling salesman problem in python, how to write a program in python, write a program that can encode and decode caesar cipher python, "write a program to solve travelling salesman problem in python", write a program to implement link list with insert, delete, search function, write a python program to convert unix timestamp string to readable date., write a python program to find the date of the first monday of a given week., write a program that asks the user to enter five test scores python, how to write a python program, write a python program to remove duplicates from tuple, write a program to implement a packet sniffing tool in python., write a program that asks the user for his name and greets him with his name in python, write a program in prolog to implement dfs (depth first search), write python program that asks user to input their name along with age and store data in a text file

İşveren Hakkında:
( 0 değerlendirme ) New Delhi, India

Proje NO: #31542093

Bu iş için 6 freelancer ortalamada ₹6769 teklif veriyor

gowthamsarathy

Hi there yes I am python expert and | am sure I can do this one ASAP Kindly send me a message we'll discuss further Looking forward to hear you Thank you.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% INR
(3 Değerlendirme)
2.2
Aitruework

Hi. I am a data scientist. I am very familiar to Deep learning apis such as Tensorflow and fastai, mxnet. I have a good hands on working with Advanced R and Python and BI tools and technologies, AI, Big Data. I have Daha Fazla

₹11111 INR in 5 gün içinde
(4 Değerlendirme)
1.8
dubey233310

Hello! Greetings I have seen your posted project on Freelancer and I feel very much interested to work with you. I have read the things that you want. I consider myself perfect match for this project because I am curr Daha Fazla

₹4000 INR in 2 gün içinde
(0 Değerlendirme)
0.0
mehulkishorkumar

Hi, I have extensive experience working with Python and Machine Learning. I can do task within budget and timeline. Please ping to discuss further.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% INR
(0 Değerlendirme)
1.7
anas1590

I would like to apply for this job. I have a firm grip on the concepts of Python, and I have 2+ years of experience in this programming language. I have worked on several projects. I assure you that you will be satisfi Daha Fazla

₹1500 INR in 2 gün içinde
(0 Değerlendirme)
0.0
abdf2010

Hi, It is easy,I can do on time.I work online, where you can track progress of your project.I have 6 years of experience in development(websites,web applications,mobile apps, desktop applications,UI/UX), using PHP, Wor Daha Fazla

₹12500 INR in 2 gün içinde
(0 Değerlendirme)
0.0