Question: Write the code for the following function: def possibleFollowingStates ( initialState: List [ List [ char ] ] ) - > List [ List [

Write the code for the following function:
def possibleFollowingStates(initialState: List[List[char]])-> List[List[List[char]]]
where the input initialState consists of a list of lists of chars representing a matrix of board pieces in the game Huarong Pass. These chars include ".","<",">","v","^","1","2"."." represents an empty space which pieces can move into, "<" and ">" represent the left and right sides of a 2 by 1 horizontal block, "^" and "v" represent the top and bottom of a 1 by 2 verticle block, "1" represents a section of a 2 by 2 square block (4 sections total touching one another), and "2" represents a single 1 by 1 block. The goal is given some initial state the function returns all possible subsequenct states that can be derived for a board of width 4 by length y where y can be any positive number. See below for an example of an initial state and a single subsequent state.
2^22
2v<>
<><>
11.^
11.v
2^22
2v<>
<><>
.11^
.11v

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!