Cody

Problem 2873. feeling VERY lucky?

Solution 3359038

Submitted on 24 Oct 2020
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   Fail
problem=2873; lines=textread('lucky.m','%s'); id=str2num(regexp(lines{end},'\d+','match','once')); html=urlread(sprintf('http://www.mathworks.com/matlabcentral/cody/problems/%d/solutions?term=player_id:%d',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!')

s = struct with fields: Type: 'twister' Seed: 1205984023 State: [625×1 uint32] y = 10

Good guess! but wrong, sorry...

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!