Cody

Solution 2022755

Submitted on 15 Nov 2019 at 9:33
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
inStr = 'doug'; shift = 10; outStr = 'nyeq'; assert(isequal(cypher(inStr, shift),outStr))

bcc = 'abcdefghjklmnopqrstuvwxyz' k = 4 k = 14 k = 20

Index exceeds the number of array elements (25). Error in cypher (line 5) inStr(i)=bcc(k+shift); Error in Test1 (line 5) assert(isequal(cypher(inStr, shift),outStr))

2   Fail
inStr = 'thequickbrownfox'; shift = 5; outStr = 'ymjvznhpgwtbsktc'; assert(isequal(cypher(inStr, shift),outStr))

bcc = 'abcdefghjklmnopqrstuvwxyz' k = 19 k = 8 k = 5 k = 16 k = 20 k = 1×0 empty double row vector

Unable to perform assignment because the left and right sides have a different number of elements. Error in cypher (line 5) inStr(i)=bcc(k+shift); Error in Test2 (line 5) assert(isequal(cypher(inStr, shift),outStr))

3   Fail
inStr = 'thecrowfliesatmidnight'; shift = 22; outStr = 'pdaynksbheaowpiezjecdp'; assert(isequal(cypher(inStr, shift),outStr))

bcc = 'abcdefghjklmnopqrstuvwxyz' k = 19

Index exceeds the number of array elements (25). Error in cypher (line 5) inStr(i)=bcc(k+shift); Error in Test3 (line 5) assert(isequal(cypher(inStr, shift),outStr))