function avg_winnings = Craps(bet, num_sims)

winnings = 0;


for i = 1:num_sims

    roll = randi(6) + randi(6);
    
    if roll == 7 || roll == 11
        winnings = winnings + bet;
    elseif roll <= 3 || roll == 12
        winnings = winnings - bet;
    else
        point = roll;
        newroll = 0;
        while(newroll ~= point && newroll~= 7)
            newroll = randi(6) + randi(6);
        end
        
        if newroll == 7
            winnings = winnings - bet;
        elseif newroll == point
            winnings = winnings + bet;
        end
    end
    
end

avg_winnings = winnings/num_sims;

end