Cody

Solution 2328178

Submitted on 22 May 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   Pass
KNIGHT=true; PASSWORD='PASSWORD'; g=inline('logical(interp1([0,1],[0,x],1))','x','KNIGHT','PASSWORD'); F=@(str)xor(~KNIGHT,g(eval(str),KNIGHT,PASSWORD)); clear g KNIGHT PASSWORD; assert(isequal(solver(F),'PASSWORD'))

t = 0.5000 b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' a = 1 i = 0 i = 10 password = 'PASSWORD'

2   Pass
KNIGHT=false; PASSWORD='PASSWORD'; g=inline('logical(interp1([0,1],[0,x],1))','x','KNIGHT','PASSWORD'); F=@(str)xor(~KNIGHT,g(eval(str),KNIGHT,PASSWORD)); clear g KNIGHT PASSWORD; assert(isequal(solver(F),'PASSWORD'))

t = -0.5000 b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' a = 1 i = 0 i = 10 password = 'PASSWORD'

3   Fail
KNIGHT=false; PASSWORD='DONOTPANIC'; g=inline('logical(interp1([0,1],[0,x],1))','x','KNIGHT','PASSWORD'); F=@(str)xor(~KNIGHT,g(eval(str),KNIGHT,PASSWORD)); clear g KNIGHT PASSWORD; assert(isequal(solver(F),'DONOTPANIC'))

t = -0.5000 b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' a = 1 i = 0 i = 10 password = 'PASSWORD'

Assertion failed.

4   Fail
KNIGHT=true; PASSWORD='FORTYTWO'; g=inline('logical(interp1([0,1],[0,x],1))','x','KNIGHT','PASSWORD'); F=@(str)xor(~KNIGHT,g(eval(str),KNIGHT,PASSWORD)); clear g KNIGHT PASSWORD; assert(isequal(solver(F),'FORTYTWO'))

t = 0.5000 b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' a = 1 i = 0 i = 10 password = 'PASSWORD'

Assertion failed.

5   Fail
KNIGHT=false; PASSWORD='PLEASELETMEIN'; g=inline('logical(interp1([0,1],[0,x],1))','x','KNIGHT','PASSWORD'); F=@(str)xor(~KNIGHT,g(eval(str),KNIGHT,PASSWORD)); clear g KNIGHT PASSWORD; assert(isequal(solver(F),'PLEASELETMEIN'))

t = -0.5000 b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' a = 1 i = 0 i = 10 password = 'PASSWORD'

Assertion failed.