GitHub repository: rlaurensherman/group-stagger
Created: 2018-01-01T00:22:56Z
Description: This program simulates a group of sailors staggering around a square grid floor to estimate how many steps are required for every location on the floor to be visited by at least x sailors. The input parameters provide the dimension of the floor, the number of sailors, and the minimum number of visits (x) per location. Each sailor is assigned a letter and is represented by a separate thread. The sailors begin at random locations on the floor and stagger in random directions. The program outputs a grid of strings. Each string corresponds to a location on the floor, and tracks the letter of each sailor who visits the location, until the location has been visited by the minimum number of sailors. Following the grid of strings, the program outputs the number of steps that each sailor takes, and the total number of steps taken.