Need help with MatLab script, from start to finish?

조회 수: 1 (최근 30일)
Martin Kao
Martin Kao 2016년 3월 25일
댓글: Diego Portilla 2016년 6월 11일
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
Martin Kao
Martin Kao 2016년 3월 26일
편집: Walter Roberson 2016년 3월 26일
The user enters
player_move=menu('Choose your weapon:','rock', 'paper', 'scissors')
Diego Portilla
Diego Portilla 2016년 6월 11일
what about, how to make matlab choose a random weapon and compare them?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 3월 25일
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.

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by