%This file simulates a single at bat.
%The variable r contains a "1" if Tony gets a hit,
%that is, if rand <=0.339; and it contains a "-1"
%if Tony fails to hit safely, that is, if rand >0.339.
s=rand;
if s <=0.339
    r=1;
else
    r=0;
end
