Can't decide what to watch on TV? How about settling the dispute with a good old fashioned round of Paper Scissors Lizard Spock ? Given your opponents choice and a strategy ("win", "lose", or "tie"), return a string representing the choice(s) that would yield that desired outcome.
Ex:
rpsls("rock","lose")
ans = {"Spock", "paper"} %%you will lose if you choose either Spock or paper
rpsls("paper", "tie")
ans = "paper" %%you will tie if you select the same choice

Solution Stats

125 Solutions

22 Solvers

Last Solution submitted on Jan 20, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers22

Suggested Problems

More from this Author1

Problem Tags

Community Treasure Hunt

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

Start Hunting!