Answer:
Step-by-step explanation:
Coding is all about logic, since I do not have the actual problem from the website I will guide you on how to solve this.
Since you need to go a certain direction you will need to indicate to the character which direction to go. Next, we need to prevent the player from travelling through a wall, we can accomplish this using an IF/ELSE statement. IF the next block in that direction is a wall then do not move forward, ELSE move forward. We would call this statement every time the player tries to move in any direction. Finally, once we reach the lettuce we need to continue picking it until there is no more. To do this we use a While loop, that checks to see if there is any more lettuce, if there is it will run the code to pick up lettuce, if there is NO more then the While loop will exit. That would be the entire code.