function [winner, rolls] = game()
% Plays a simple game

% Written by Paul Chew for CS100M, Feb 2006

player = 1;
d1 = diceRoll();
d2 = diceRoll();
rolls = 1;
while d1 ~= d2
    player = 3 - player;
    d1 = diceRoll(); d2 = diceRoll();
    rolls = rolls + 1;
end
winner = player;


function number = diceRoll ()
% Helper function
number = ceil(6 * rand(1));