Rolling dice multiple times?

19 Ansichten (letzte 30 Tage)
Brian Tiffman
Brian Tiffman am 22 Jan. 2016
Beantwortet: Walter Roberson am 22 Jan. 2016
I want to have my code to roll five dice once, which I will do using the randi command. I then want to reroll certain dice two more times. For example, after the first roll maybe I want to keep dice 2 and 4, but I want to reroll the rest. Can someone give me some insight into how I would do this. I just want some guidance toward this. Your help is appreciated. Thanks.

Antworten (1)

Walter Roberson
Walter Roberson am 22 Jan. 2016
Hint:
rolled(columns_to_discard) = new_random_values;

Kategorien

Mehr zu Word games finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by