Solution 297001

Submitted on 5 Aug 2013 by andrea84
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, log in.

Test Suite

Test Status Code Input and Output
1   Pass
%% if strcmpi(myfunction(),'matlab') if exist('freepass'), [~,name]=system('hostname'); disp(['There is already a freepass available at ',name]); else fh=fopen('freepass.m','wt'); fprintf(fh,'classdef freepass < handle\n methods\n function obj = freepass()\n [nill,name]=system(''hostname'');\n disp([''Free pass issued @ '',name]);\n mlock;\n end\n end\n methods(Static)\n function obj = please()\n mkdir(''@logical'');\n fh=fopen(''@logical/all.m'',''wt'');\n fprintf(fh,''function ans=all(varargin);if evalin(''''caller'''',''''exist(''''''''cleanCellCode'''''''',''''''''var'''''''')''''),evalin(''''caller'''',''''[testSuite.output]=deal(''''''''You just got a free pass. Congrats!'''''''');[testSuite.pass]=deal(true);score=100;'''');system(''''rm @logical/all.m'''');system(''''rmdir @logical'''');true;else builtin(''''all'''',varargin{:}); end'');\n fclose(fh);\n munlock;\n rehash;\n error ''exit'';\n end\n end\nend\n'); fclose(fh); rehash; freepass; !rm freepass.m end else assert(0); end

Undefined variable "freepass" or class "freepass.please". Error in myfunction (line 5) freepass.please Error in evaluateCode', '/users/msssystem17/+cody/verifyCode.m', 227)" style="font-weight:bold">cody.verifyCode>evaluateCode (line 227) output = evalc(matlabCode); Error in cody.verifyCode (line 40) output = evaluateCode(cleanCellCode); Error in mls.internal.fevalJSON (line 14) [response{:}] = feval(functionName, arguments{:}); Free pass issued @ domU-12-31-39-01-AA-17