Cody

# Problem 46072. Rock Paper Scissors Lizard Spock

Solution 2782045

Submitted on 4 Aug 2020 by Hope Dargan
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(rpsls("rock","win"), {l, sc})|| isequal(rpsls("rock","win"), {sc, l}))

2   Pass
assert(isequal(rpsls("rock","lose"), {sp, p}) || isequal(rpsls("rock","lose"), {p, sp}))

3   Pass
assert(isequal(rpsls("rock","tie"), r))

4   Pass
assert(isequal(rpsls("paper","win"), {sp, r}) || isequal(rpsls("paper","win"), {r,sp}))

5   Pass
assert(isequal(rpsls("paper","lose"), {sc, l}) || isequal(rpsls("paper","lose"), {l, sc}))

6   Pass
assert(isequal(rpsls("paper","tie"), p))

7   Pass
assert(isequal(rpsls("scissors","win"), {l, p}) || isequal(rpsls("scissors","win"), {p, l}))

8   Pass
assert(isequal(rpsls("scissors","lose"), {r, sp}) || isequal(rpsls("scissors","lose"), {sp, r}))

9   Pass
assert(isequal(rpsls("scissors","tie"), sc))

10   Pass
assert(isequal(rpsls("lizard","win"), {p, sp}) || isequal(rpsls("lizard","win"), {sp, p}))

11   Pass
assert(isequal(rpsls("lizard","lose"), {sc, r}) || isequal(rpsls("lizard","lose"), {r, sc}))

12   Pass
assert(isequal(rpsls("lizard","tie"), l))

13   Pass
assert(isequal(rpsls("Spock","win"), {r, sc}) || isequal(rpsls("Spock","win"), {sc, r}))

14   Pass
assert(isequal(rpsls("Spock","lose"), {p, l}) || isequal(rpsls("Spock","lose"), {l, p}))

15   Pass
assert(isequal(rpsls("Spock","tie"), sp))

### Community Treasure Hunt

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

Start Hunting!