Very neat solution
He just wrote all the matrices...that's not neat, but everyone has the right to an opinion.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
rollnum = 1;
diceFace = [0 0 0; 0 1 0; 0 0 0];
assert(isequal(rollADie(rollnum),diceFace))
|
2 | Pass |
%%
rollnum = 2;
diceFace = [0 0 1; 0 0 0; 1 0 0];
assert(isequal(rollADie(rollnum),diceFace))
|
3 | Pass |
%%
rollnum = 3;
diceFace = [0 0 1; 0 1 0; 1 0 0];
assert(isequal(rollADie(rollnum),diceFace))
|
4 | Pass |
%%
rollnum = 4;
diceFace = [1 0 1; 0 0 0; 1 0 1];
assert(isequal(rollADie(rollnum),diceFace))
|
5 | Pass |
%%
rollnum = 5;
diceFace = [1 0 1; 0 1 0; 1 0 1];
assert(isequal(rollADie(rollnum),diceFace))
|
6 | Pass |
%%
rollnum = 6;
diceFace = [1 0 1; 1 0 1; 1 0 1];
assert(isequal(rollADie(rollnum),diceFace))
|
874 Solvers
Check to see if a Sudoku Puzzle is Solved
278 Solvers
Who is the smartest MATLAB programmer?
561 Solvers
The sum of the numbers in the vector
426 Solvers
251 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!