/animal-race

Race against the rabbit assignment for Code Fellows

This script runs a race between two contestants.

The contestants consist of objects of the custom Animal type.

They have 4 variables: name speed focus position

The race consists of a function call with 3 inputs: contestant1 object contestant2 object distance

A while loop runs until one of the contestants position is greater than or equal to the race distance.

The results are output depending on which contestant has gone past the input distance. A unique message will display in case of a tie. Otherwise the results will display the winner and the distance between them and the loser at the time of victory.