function [winner, rolls] = game()
% Report results of a simple game

player = 1;
d1 = diceRoll();
d2 = diceRoll();
rolls = 1;
while d1 ~= d2              % Quit when someone rolls doubles
	player = 3 - player;    % Switch players
	d1 = diceRoll(); d2 = diceRoll();
	rolls = rolls + 1;
end
winner = player;

function value = diceRoll()
% Result of a single roll
value = ceil(6*rand(1));