Using the p5play v3 you can check the link for reference https://p5play.org/learn/ . Attempt the following question
Question:
Using the p5play v3 you can check the link for reference https://p5play.org/learn/ . Attempt the following question
The game:
1. The game consists of a 6x6 grid (the board) and a set of cars and trucks positioned on the grid. Cars are of size 1x2, and trucks are 1x3.
2. Cars are marked with the letters A, B, C, D, E, F, G, H, I, J, K, and X.
3. Trucks are marked with the letters O, P, Q, and R.
4. In each challenge, a varying number of cars and trucks are placed on the board in a specific arrangement.
5. The goal of the game is to clear a path for the red car (marked with X) out of the board to the right by moving the other vehicles.
6. The player can move the cars and trucks up and down or left and right, according to their initial orientation as long as there is no other vehicle blocking them.
Read the set of problems from the text file rh.txt. The file includes 40 different
challenges (cards) in an increasing difficulty level. Each line represents a different challenge. Each challenge is given as a 36-character string represents the 6x6 grid,
where letter represents a car/truck occupies a square, and period ('.') represents an empty square.
For example, the string "AA...OP..Q.OPXXQ.OP..Q..B...CCB.RRR." represents the following challenge/card:
You should read the 40 problems and solutions from the file and store them in an array.
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts