clear all;clc;


    first=floor(rand(1)*6)+1
    second=floor(rand(1)*6)+1

    sum=first+second

    if (sum==7 || sum==11)
        fprintf('You won the game at first roll!!')
    elseif (sum==2 || sum==3 || sum==12)
        fprintf('You lost the game at first roll!!')
    else
        point=sum;
        fprintf('Your point is %d! ', point)
        sumnew=0;
        r=1;
        while (sumnew ~= point)
            firstnew=floor(rand(1)*6)+1;
            secondnew=floor(rand(1)*6)+1;
            r=r+1;
            sumnew=firstnew+secondnew;
        end
        fprintf('You won the game after %d rolls!!', r)
    end