%trafficLight(character) -> string
%Author: James Atlas
%Description:
% Takes a character and determines the action to take at a traffic light
% and returns that action as a string.
%Examples:
% trafficLight('R') -> 'stop'
% trafficLight('Y') -> 'slow'
% trafficLight('G') -> 'go'
function out = trafficLight(currentColor)
if (currentColor == 'R')
    out = 'stop';
elseif (currentColor == 'Y')
    out = 'slow';
elseif (currentColor == 'G')
    out = 'go';
else
    out = 'look around see if it is safe';
end
