Cody

# Problem 78. Implement a ROT13 cipher

Solution 1246796

Submitted on 5 Aug 2017 by Ayanle Aden
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
s1 = 'I love MATLAB'; s2_correct = 'V ybir ZNGYNO'; assert(isequal(rot13(s1),s2_correct))

letters = 1×52 cell array Columns 1 through 25 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' Columns 26 through 50 'z' 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' Columns 51 through 52 'Y' 'Z' s1 = 'V love MATLAB' s1 = 'V yove MATLAB' s1 = 'V ybve MATLAB' s1 = 'V ybie MATLAB' s1 = 'V ybir MATLAB' s1 = 'V ybir ZATLAB' s1 = 'V ybir ZNTLAB' s1 = 'V ybir ZNGLAB' s1 = 'V ybir ZNGYAB' s1 = 'V ybir ZNGYNB' s1 = 'V ybir ZNGYNO' s2 = 'V ybir ZNGYNO'

2   Pass
s1 = 'I <3 MATLAB!!'; s2_correct = 'V <3 ZNGYNO!!'; assert(isequal(rot13(s1),s2_correct))

letters = 1×52 cell array Columns 1 through 25 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' Columns 26 through 50 'z' 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' Columns 51 through 52 'Y' 'Z' s1 = 'V <3 MATLAB!!' s1 = 'V <3 ZATLAB!!' s1 = 'V <3 ZNTLAB!!' s1 = 'V <3 ZNGLAB!!' s1 = 'V <3 ZNGYAB!!' s1 = 'V <3 ZNGYNB!!' s1 = 'V <3 ZNGYNO!!' s2 = 'V <3 ZNGYNO!!'

3   Pass
s1 = 'The quick fox stumbled over the confusing instructions.'; s2_correct = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbaf.'; assert(isequal(rot13(s1),s2_correct))

letters = 1×52 cell array Columns 1 through 25 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' Columns 26 through 50 'z' 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' Columns 51 through 52 'Y' 'Z' s1 = 'Ghe quick fox stumbled over the confusing instructions.' s1 = 'Gue quick fox stumbled over the confusing instructions.' s1 = 'Gur quick fox stumbled over the confusing instructions.' s1 = 'Gur duick fox stumbled over the confusing instructions.' s1 = 'Gur dhick fox stumbled over the confusing instructions.' s1 = 'Gur dhvck fox stumbled over the confusing instructions.' s1 = 'Gur dhvpk fox stumbled over the confusing instructions.' s1 = 'Gur dhvpx fox stumbled over the confusing instructions.' s1 = 'Gur dhvpx sox stumbled over the confusing instructions.' s1 = 'Gur dhvpx sbx stumbled over the confusing instructions.' s1 = 'Gur dhvpx sbk stumbled over the confusing instructions.' s1 = 'Gur dhvpx sbk ftumbled over the confusing instructions.' s1 = 'Gur dhvpx sbk fgumbled over the confusing instructions.' s1 = 'Gur dhvpx sbk fghmbled over the confusing instructions.' s1 = 'Gur dhvpx sbk fghzbled over the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoled over the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyed over the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrd over the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq over the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bver the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bier the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq birr the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire the confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire ghe confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gue confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur confusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur ponfusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbnfusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbafusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbasusing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashsing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfing instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvng instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvag instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat instructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vnstructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vastructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vaftructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgructions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgeuctions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehctions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehptions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgions.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvons.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbns.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbas.' s1 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbaf.' s2 = 'Gur dhvpx sbk fghzoyrq bire gur pbashfvat vafgehpgvbaf.'

4   Pass
s1 = 'Snape kills Dumbledore on page 606. Also, there is no Santa.'; s2_correct = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnagn.'; assert(isequal(rot13(s1),s2_correct))

letters = 1×52 cell array Columns 1 through 25 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' Columns 26 through 50 'z' 'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M' 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' Columns 51 through 52 'Y' 'Z' s1 = 'Fnape kills Dumbledore on page 606. Also, there is no Santa.' s1 = 'Faape kills Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fanpe kills Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fance kills Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fancr kills Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xills Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvlls Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyls Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyys Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Dumbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qumbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhmbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzbledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoledore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyedore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrdore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqore on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqbre on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqbee on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber on page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber bn page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba page 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cage 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cnge 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cnte 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Also, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nlso, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyso, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfo, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, there is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, ghere is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, guere is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurre is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, guree is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer is no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vs no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf no Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ao Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Santa.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fanta.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnnta.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnata.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnaga.' s1 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnagn.' s2 = 'Fancr xvyyf Qhzoyrqber ba cntr 606. Nyfb, gurer vf ab Fnagn.'