function newPos = moveBug(currPos)
% nP = MOVEBUG(cP) Moves a bug either to the left or the right.
% Requires the current position of the bug and 
% returns the new position of the bug after randomly choosing direction.
r = randperm(2);  % flip coin
if r(1)==1
    newPos = currPos + 1;   % move right
else
    newPos = currPos - 1;   % move left
end
