Problem 2873. feeling VERY lucky?

Solution 567492

Submitted on 28 Jan 2015 by J.R.! Menzinger
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% problem=2873; lines=textread('lucky.m','%s'); id=str2num(regexp(lines{end},'\d+','match','once')); html=urlread(sprintf('',problem,id)); n=numel(regexpi(html,'solution \d+')); if n>0, error('Sorry. You had your chance already'); end if randi(10)~=lucky(), error('Good guess! but wrong, sorry...'); end disp('Amazingly correct!')

lines = '3226229 Special THANKS to: Gregory' ans = @evalin [Warning: Function randi has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In textread at 16 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] Amazingly correct!

Suggested Problems

More from this Author38

Community Treasure Hunt

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

Start Hunting!