Question: Shaanan starts from the top left corner as before ( will move to the right ) , Yige starts from the top right corner (

Shaanan starts from the top left corner as before (will move to the right), Yige starts from the top right corner (will move downwards), Han starts from the bottom right corner (will move to the left), and Rose starts from the bottom left corner (will move upwards). No piece of lawn can be repeatedly mowed.
They start mowing at the time step 0. Then at each time step, each of the four people completes one of the three actions with their lawnmower:
* Move one step forward without turning (i.e., no change in direction).
* Turn clockwise and move one step forward. This action will only be selected if:
* moving one step forward without turning will result in the person immediately land on a coordinate that has already been mowed, AND
* after turning clockwise and move one step forward, the person immediately lands on a coordinate that has not been mowed)
* Do nothing. Select this action if the other two actions are not possible.
During each time step, Shaanan performs his action first, then Yige, then Han, then Rose.
Your Task
Write a function quad_clockwise_spiral_paths(dimension, time_step).
Input:
* dimension: row_dim, col_dim
* time_step: a non-negative int signalling the time step when mowing
Output: The function returns a list containing 4 paths, in the order of Shaanans, Yiges, Hans and Roses, at the time_step given.
Assumptions you can make:
* The inputs are well-formatted with the correct type.
* For this question, you can assume that in the dimension tuple (row_dim, col_dim), row_dim and col_dim are no less than 2.

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!