Skip to content

This is the first problem i solved with python, which is a cabbage, sheep and wolf cross river game. There is 2 methodology. One of them is the original flow that i will consider the boatman at each stage to make decision. Another is to not consider about the stage of the boat man and make the correct decision base on the cabbage, sheep and wolf…

Notifications You must be signed in to change notification settings

GaryTang32/Cross_river_problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Cross_river_problem

Cross river problem is relatedly old and amazing to know when i was a kid. The problem consist of 4 components : Boatman, sheep, cabbage and wolf. All of them is at one side of the river. The goal is to travel to the next side of the river. But there is some regulations.

1, Wolf will eat sheep when boat man is not at the same side. 2, Sheep will eat cabbage when wolf and boatman are not at the same side. 3, Each travel require boatman to use the boat. 4, Each time have only maximum 2 objects can use the boat.

This is the first problem i solved with python, which is a cabbage, sheep and wolf cross river game. There is 2 methodology. One of them is the original flow that i will consider the boatman at each stage to make decision. Another is to not consider about the stage of the boat man and make the correct decision base on the cabbage, sheep and wolf only. When execute, it will print out the path and the flow of the game.

About

This is the first problem i solved with python, which is a cabbage, sheep and wolf cross river game. There is 2 methodology. One of them is the original flow that i will consider the boatman at each stage to make decision. Another is to not consider about the stage of the boat man and make the correct decision base on the cabbage, sheep and wolf…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages