GitHub repository: rlaurensherman/sailor-stagger
Created: 2018-01-01T00:14:57Z
Description: This program simulates a sailor staggering around a floor to determine the number of steps it will take the sailor to fall off the edge of the floor. For each step the sailor takes, the program randomly selects one of eight directions in which the sailor will move. Once the sailor steps outside of the grid floor – having dimensions given by input parameters – the experiment ends. The input parameters also include the number of experiments that the program will run. The program outputs the number of steps the sailor takes for each experiment, followed by the average number of steps from all experiments.  There are two versions of this program: a sequential version and a parallel version. The parallel version forks a new child process for each experiment, and outputs the PID and exit status of each child process when it exits.