Can we make some program in matlab like this?
URL Download Link disabled......
Printable View
Can we make some program in matlab like this?
URL Download Link disabled......
Please DO NOT link to EXE files..
Rather explain what your looking to do.....
I have this little game
And I just want to plot the statistics in figure.Code:% minimalistic rock, paper, scissors game
% W. Schleter July 28, 2003
clear all; close all; clc;
irock = 1; ipaper = 2; iscissors = 3;
iwin = 1; itie = 2; ilose = 3;
wintext = {'you win','we tie','you lose'};
itemtext = {'rock','paper','scissors'};
win = [itie ilose iwin
iwin itie ilose
ilose iwin itie];
totals = [0 0 0];
while (1)
a = input('Enter R, P, S, or Q: ','s');
iuser = strfind('RPSQ',upper(a));
if (isempty(iuser) || iuser<1 || iuser>4)
fprintf('Huh?\n')
else
if (iuser==4), break; end
icomputer = floor(rand(1)*3+1);
iresult = win(iuser,icomputer);
fprintf(' You chose %s, I chose %s, %s\n', ...
char(itemtext(iuser)),char(itemtext(icomputer)), ...
char(wintext(iresult)));
totals(iresult) = totals(iresult)+1;
fprintf(' Your stats: Games: %.0f, wins: %.0f, ties: %.0f, losses: %.0f\n\n',sum(totals),totals);
end
end