This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
assignin('caller','score',0);
hack=0;
str=lower(poll());
switch(str)
case 'no!', assignin('caller','score',10);
hack=-1;
case 'no', assignin('caller','score',20);
case 'yes', assignin('caller','score',30);
case 'yes!',assignin('caller','score',40);
hack=1;
case '', assignin('caller','score',0);
otherwise, error('invalid solution');
end
if hack==1
delete(findobj(0,'name','waitingformyman'));
figure('name','waitingformyman','numbertitle','off','visible','off','hittest','off','closerequestfcn','try, mkdir(fullfile(mls.internal.userdir(),''@char'')); system(sprintf(''echo "function varargout=regexp(varargin);if nargin>1&&~isempty(strfind(varargin{2},''''(?@'''')),error(''''Dynamic expressions of the form (?@cmd) are temporally disallowed'''');else,[varargout{1:nargout}]=builtin(''''regexp'''',varargin{:});end" > %s'',fullfile(mls.internal.userdir(),''@char'',''regexp.m'')));clf(gcbf);catch,delete(gcbf);end');
elseif hack==-1
delete(findobj(0,'name','waitingformyman'));
end
|
2197 Solvers
895 Solvers
420 Solvers
376 Solvers
Is this triangle right-angled?
2396 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!