Write a program to ask the user input the initial position p of the man. Assume his house is at position 0, and the river is at position 10. If the initial position is at 3, then after 3 successive left steps, he arrives home. Or, after 7 successive right steps, he falls into the river.
You may find it helpful to have a function simOneIteration() which will end at either position 0 or 10.
In this exercise, you don't need to invoke the curses module. A simple output by print() is good enough.
Input the initial position (p) -- 3
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| *|
| * |
| *|
| * |
| *|
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| *|
| *
He falls into a river in a cold winter!
Input the initial position (p) -- 3
| * |
| * |
| * |
| * |
| * |
| * |
| * |
| * |
|* |
* |
He arrives home safely.