![]() |
.. (לתיקייה המכילה) | |
In the function "findShortest", can we assume there is a solution to the puzzle? | |
Yes. You may also assume the shortest solution has at most MaxLen moves. |
What else can we assume about the input? | |
You can assume that: - The astronaut will not start at the finish point. - If the moves series given to checkSol function solves the puzzle, the astronaut will reach the finish point only after the last move is executed. |
Is it allowed to change the board? | |
Yes. In any of the functions it is allowed to modify the board. |
How is an illegal move defined in the subroutine movePiece? | |
The same as it was defined in HW 2. Specifically, a move is considered illegal if: - The selected square is not inside the board. - The selected square does not contain a robot/astronaut. - There is no other object in the chosen direction. You do not need to check whether the robot has already been in the destination square. |
It was written In the assignment that the functions should not use global variables (beside the ones specified in each function's description).
| |
Yes! Your functions can use variables defined in common area as long as you initialize them inside the functions (or in other words, the functions should not assume these variables are already initialized). |
Do we need to check in the function checkSol for a solution according to the definition in HW 2, or according to the definition in HW3? | |
Both definitions are fine. You can choose either of them and check for a solution accordingly. |
Can we leave "garbage" values in the Moves array after the '@'? | |
Yes. |
Can we use the parameter MaxLen inside the subroutine findShortest? | |
Yes. You may assume that the shortest solution has less than MaxLen moves. |