Cody

Problem 751. Implement simple rotation cypher

Solution 1586559

Submitted on 18 Jul 2018 by Ankith Rathod
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
inStr = 'doug'; shift = 10; outStr = 'nyeq'; assert(isequal(cypher(inStr, shift),outStr))

outStr = 'nyq' outStr = 'nyeq'

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

outStr = 'ymjvznhpgwt|skt}' outStr = 'ymjvznhpgwtbskt}' outStr = 'ymjvznhpgwtbsktc'

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

outStr = '~{y|{wz}~' outStr = 'p~{y|{wz}~' outStr = 'pd{y|{wz}~' outStr = 'pday|{wz}~' outStr = 'pdayn|{wz}~' outStr = 'pdaynk|{wz}~' outStr = 'pdaynks|{wz}~' outStr = 'pdaynksb{wz}~' outStr = 'pdaynksbh{wz}~' outStr = 'pdaynksbhe{wz}~' outStr = 'pdaynksbheawz}~' outStr = 'pdaynksbheaowz}~' outStr = 'pdaynksbheaowpz}~' outStr = 'pdaynksbheaowpiz}~' outStr = 'pdaynksbheaowpiez}~' outStr = 'pdaynksbheaowpiezj}~' outStr = 'pdaynksbheaowpiezje}~' outStr = 'pdaynksbheaowpiezjec~' outStr = 'pdaynksbheaowpiezjecd' outStr = 'pdaynksbheaowpiezjecdp'

Community Treasure Hunt

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

Start Hunting!