Problem 46072. Rock Paper Scissors Lizard Spock

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.
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

32.23% Correct | 67.77% Incorrect
Last Solution submitted on Sep 21, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers20

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!