% M-file for flipping a coin

% Generate a random number in (0,2)
x = 2*rand(1);

% Determine if heads or tails
if (floor(x) == 0)
	fprintf('Your coin landed head side up!\n')
else
	fprintf('Your coin landed tail side up!\n')
end


% M-file for rolling a die

% Generate a random number in (0,6)
x = 6*rand(1);

% Print out result
fprintf('You rolled a %d.\n',ceil(x))