The Drunken Sailor Problem

 

There is a drunken sailor walking around the pier.   Every minute he rolls a four sided dice.   He goes North, South, East, or West as the dice says.   The pier is 11 spaces by 11 spaces.   He starts in the middle.  How long does it take for him to fall off?

 

This program is out of 38 points.   I expect the average person to get maybe about around approximately 23 points.

 

It took me 30 minutes to get 19 points.   That used 30 executable lines.

 

The Points List

Points

Task

5

The sailor can walk around directed by the coin.

2

The sailor stops when he falls of the edge.

5

There are many sailors, and your program prints an average of many runs.

2

Your program also prints the min and max of all the runs.

5

Your program prints a histogram of the many runs.

2

Your program can use a pier of any reasonable dimensions (and won’t crash if I enter stupid numbers).

5

Your program can produce a list of many pier sizes and the average walk-off time for each size.

2

Your program has at least two methods (counting main).

5

Your program shows a map of every space visited during the drunken walk (requires arrays).

-10

Your program is not indented.

3

Your program is turned in BEFORE September 12 th.

-3

Your program is turned in AFTER September 12 th.

-5
Your program is turned in AFTER Monday September 15th.

2

In the comments of your program you list your name and how many points you claim.

-2

You fail to include decimal points in your averages.

-1

Every warning generated by the compiler.

+1

For every one of the three loop types you use (while, for, and do)    

 

 I will not accept this program after September 18th