Question
Need a GUI for this rock paper scissors code on Matlab. close all clc clear var player1=input('Player 1 please choose 1 for rock, 2 for
Need a GUI for this rock paper scissors code on Matlab.
close all clc clear var player1=input('Player 1 please choose 1 for rock, 2 for paper, or 3 for scissors:'); player2=input('Player 2 please choose 1 for rock, 2 for paper, or 3 for scissors:'); if player1 == 1 if player2 == 1 result = 'Tie!' elseif player2 == 2 result = 'Player 2 wins!' else result = 'Player 1 loses!' end elseif player1 == 2 if player2 == 1 result = 'Player 1 wins!' elseif player2 == 2 result = 'Tie!' else result = 'Player 2 loses!' end elseif player1 == 3 if player2 == 1 result = 'Player 2 wins!' elseif player2 == 2 result = 'Player 1 wins!' else result = 'Tie!' end for k = 1:3 end end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started