In assembly language .code mov eax,100 call RandomRange inc eax mov ranNum, eax
ID: 3910849 • Letter: I
Question
In assembly language .code mov eax,100 call RandomRange inc eax mov ranNum, eax Can you show me to simulate the toss of the 6 sided dice using the random range function above and to randomize so it rolls a number between 1-6 In assembly language .code mov eax,100 call RandomRange inc eax mov ranNum, eax Can you show me to simulate the toss of the 6 sided dice using the random range function above and to randomize so it rolls a number between 1-6 .code mov eax,100 call RandomRange inc eax mov ranNum, eax Can you show me to simulate the toss of the 6 sided dice using the random range function above and to randomize so it rolls a number between 1-6Explanation / Answer
//As per my understanding, see the below code
//let me know incase you face any difficulty
roll = 100;
for i = 1:roll
dice_no = ceil(6 * rand);
//after random no generated, you can apply your login here
end
//////Another Function below
function [DieResult Special] = t6(n)
D = floor(rand(1,n)*6) + 1;
//////Another Function below
function [DieResult Special] = t6(n)
DieResult = 0;
NumberOnes = 0;
NumberTwos = 0;
NumberThrees = 0;
NumberSixes = 0;
for k=1:n % Rolls the dice in loop
DieRolls = floor(rand()*6) + 1;
if DieRolls == 1
NumberOnes = NumberOnes + 1;
elseif DieRolls == 2
NumberTwos = NumberTwos + 1;
elseif DieRolls == 3
NumberThrees = NumberThrees + 1;
elseif DieRolls == 6
NumberSixes = NumberSixes + 1;
end
DieResult = DieResult + DieRolls;
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.