still_in_game = true(1, number_of_players);
while any(still_in_game)
for player_number = find(still_in_game)
if dice == chosen_num(player_number)
fprintf(' Player %.0f youre knocked out.\n', player_number);
still_in_game(player_number) = false;
end
end
for player_number = find(still_in_game)
fprintf('Player %.0f Youre still in.\n', player_number);
end
end
Best Answer