Part VI: Move Starman by Movement Commands (20 points) Write a function move() t
ID: 3596015 • Letter: P
Question
Part VI: Move Starman by Movement Commands (20 points) Write a function move() that takes the following arguments, in this order 1. board: A game board. 2. movement: A string that represents what kind of movement that Starman needs to perform. Four move- ment commands are listed below U: go up one rw ·"D":go down one row L' go left one columa .R': goright one column Note: You may assume that the movement is always one of the four valid ones in this part. This function should call the four functions you wrote for Parts II through V Your movefunction should check the value of movement and then perform the cotresponding movement by calling the appropriate function you write in Part II through V. move must also return the value that is returned from the function that it calls. As an example, if the value of movenent is 'U,then move) will return whatever value is returned by move.up) Hint: Don't over-think this problem it is lilour conditional statements based on movement's value. Under each conditional statement you call one of the moveX functions and return the result from the function call Examples: CSE 101-Fall 2017 Homework #3 Page 9 Return Value Function move [board!, 'U') [2, 5 move (board2, 'D) [4, move (board, 'L move (board4, 'R Updated boards: board3" [['F, , ,w, , ,, , ,.., ,w, ],Explanation / Answer
Based on the basic implementation of game scenario, below is the java(assumption) class. For better implementation please define the rules of this board game so that such conditions can be implemented in below class: