Need help with MatLab script, from start to finish?
Show older comments
Write the script rps.m that implements a single round of Rock-Paper-Scissors. The script should secretly select a random weapon (Rock, Paper, or Scissors) and then prompt the user to input their choice of weapon. Then, the script should compare the chosen weapons and determine whether the human player won, lost, or tied. The result should be displayed using correct terminology, e.g. “Rock crushes Scissors (you lose)”, or “Scissors cut Paper (you win)”.
3 Comments
Sara Hafeez
on 25 Mar 2016
please complete the question, do the user has to enter the data in string also then do a string comparison.
Martin Kao
on 26 Mar 2016
Edited: Walter Roberson
on 26 Mar 2016
Diego Portilla
on 11 Jun 2016
what about, how to make matlab choose a random weapon and compare them?
Answers (1)
Walter Roberson
on 25 Mar 2016
0 votes
That kind of tutoring "from start to finish" takes hours and hours, and requires a lot of back and forth interaction, as we have no idea what your familiarity level is with programming or MATLAB.
Speaking for myself: I would not even attempt that kind of tutoring except in-person -- and if not outright paid then at the very least for a non-trivial charitable donation tax deduction. It is hard work for the teacher.
Categories
Find more on Just for fun in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!