Roll the Dice! - MATLAB Cody - MATLAB Central

Problem 174. Roll the Dice!

Difficulty:Rate
Description
Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice.
Example
[x1,x2] = rollDice();
x1 = 5;
x2 = 2;

Solution Stats

50.05% Correct | 49.95% Incorrect
Last Solution submitted on Jun 28, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
2
3

Problem Recent Solvers10524

Suggested Problems

More from this Author56

Community Treasure Hunt

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

Start Hunting!