Question: Use function, list, if or while loop to finish a river crossing game using colab 10 Sample Session 1 Welcome. You have to bring the


10 Sample Session 1 Welcome. You have to bring the fox, the goose, and the cron across the river. Boat A Fox Goose Corn You are now at the near shore, what do you want to take? Goose Boat Fox Corn You are now at the far shore, what do you want to take? ne Goose Boat Fox Corn You are now at the near shore, what do you want to take? f@ Goose Fox Boat Corn You are now at the far shore, what do you want to take? ga Fox Boat Goose Corn You are now at the near shore, what do you want to take? de Fox Corn Boat Goose You are now at the far shore, what do you want to take? Boat Fox Goose Corn You are now at the near shore, what do you want to take? Fox Goose Corn Boat Congratulations! You have brought all itens across the river. 11 Sample Session 2 Welcome. You have to bring the fox, the goose, and the cron across the river. Boat Fox Goose You are now at the near shore, what do you want to take? foxa You have entered an invalid command. Boat Fox Goose Corn You are now at the near shore, what do you want to take? fa Fox Boat Goose Corn You have failed. The goose has eaten the cron. Accept the following five one-character strings as valid commands: f, g, c, n, or q. After receiving a valid command from the user, the game should: . - f, g, or c: move the fox, goose, or corn, if available, to the opposite shore along with the boat. - n: move the boat to the opposite shore without any item. q: quite the game. break down your program into functions with reasonable length. use functions and/or lists to reduce redundancy. The sample output is shown in the picture
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
