Write My Paper Button

WhatsApp Widget

Python programming Part VI: Move Starman by Movement Commands (20 points) Write a function move ()…

Homework Help Question & Answers

Python programming Part VI: Move Starman by Movement Commands (20 points) Write a function move ()…

Python programming

Part VI: Move Starman by Movement Commands (20 points) Write a function move () that takes the following arguments, in this order I. 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 row ·”D”: go down one row : go left one column “R”: go right one column Nole: You may assume that the movement is always one of the four valid ones in this part This function shouild call the four functions you wrote for Parts I hrough V Your move () function should check the value of movement and then perform the corresponding movement returned from the function that it cals, As an example, if the value of movement is ‘D’, then move() w Hint: Don’t over-think this problem – it is lierally four conditional statements hased on movement ‘s value is ill by calling the appropriate function you write in Part II through V. move 0 must also return the value that return whatever value is returned by move up () Under each conditional s tatement you call one of the move X () functions and return the result from the function call. Examples: I’0W. W01 board3 [[, F’, ‘W’, ,F, , ,.,, ,W’), = CSE 101-Fall 2017 Homework #3 Page 9
0 0
Add a comment
Don`t copy text!
WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
???? Hi, how can I help?