Cody

Problem 42525. Vigenere cipher - be like Sherlock Holmes!

Solution 2946772

Submitted on 14 Sep 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
a='CTMCCDCTWCWG'; b='CAT'; y_correct = 'ATTACKATDAWN'; assert(isequal(decrypt(a,b),y_correct));

Unrecognized function or variable 'f'. Error in decrypt (line 2) text = cipher;f Error in Test1 (line 4) assert(isequal(decrypt(a,b),y_correct));

2   Fail
a='ctmccdctwcwg'; b='cat'; y_correct='ATTACKATDAWN'; assert(isequal(decrypt(a,b),y_correct));

Unrecognized function or variable 'f'. Error in decrypt (line 2) text = cipher;f Error in Test2 (line 4) assert(isequal(decrypt(a,b),y_correct));

3   Fail
a='uaflgsqamnoeqr'; b='matlab'; y_correct='IAMAGREATCODER'; assert(isequal(decrypt(a,b),y_correct));

Unrecognized function or variable 'f'. Error in decrypt (line 2) text = cipher;f Error in Test3 (line 4) assert(isequal(decrypt(a,b),y_correct));

4   Fail
ind = randi(3); switch ind case 1 a='sdirmclkvtldnyimhstdoecfnfsdirmclkvtldnyimhstdoecfnfsdirmclkvtldnyimhstdoecfnfsdirmclkvtldnyimhstdoecfnf'; b='cheater'; y_correct = 'QWERTYUIOPLKJHGFDSAZXCVBNMOMGKICSGEREZNFEVFLPDVALDGBSKEAKVHKCPUBGUITDBRWKEJBWDLZIYILJDRTSZWWBIHZPMMXYFUB'; assert(isequal(decrypt(a,b),y_correct)); case 2 a='mbvoegshbukmynhaqsetnhvykz' b='matlab' y_correct='ABCDEFGHIJKLMNOPQRSTUWVXYZ' assert(isequal(decrypt(a,b),y_correct)); case 3 a='az' b='za' y_correct='BZ' assert(isequal(decrypt(a,b),y_correct)); end

Unrecognized function or variable 'f'. Error in decrypt (line 2) text = cipher;f Error in Test4 (line 7) assert(isequal(decrypt(a,b),y_correct));

5   Pass
filetext = fileread('decrypt.m'); assert(isempty(strfind(filetext, 'IAMAGREATCODER')),'forbidden')

6   Fail
a='CtMcCdCTwcWG'; b='CAt'; y_correct = 'ATTACKATDAWN'; assert(isequal(decrypt(a,b),y_correct));

Unrecognized function or variable 'f'. Error in decrypt (line 2) text = cipher;f Error in Test6 (line 4) assert(isequal(decrypt(a,b),y_correct));

Suggested Problems

Community Treasure Hunt

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

Start Hunting!