Cody

# Problem 751. Implement simple rotation cypher

Solution 2022806

Submitted on 15 Nov 2019 by Le Cong Hieu
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))

bcc = 'abcdefghijklmnopqrstuvwxyz' k = 4 inStr = 'noug' k = 15 inStr = 'nyug' k = 21 inStr = 'nyeg' k = 7 inStr = 'nyeq' outStr = 'nyeq'

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

bcc = 'abcdefghijklmnopqrstuvwxyz' k = 20 inStr = 'yhequickbrownfox' k = 8 inStr = 'ymequickbrownfox' k = 5 inStr = 'ymjquickbrownfox' k = 17 inStr = 'ymjvuickbrownfox' k = 21 inStr = 'ymjvzickbrownfox' k = 9 inStr = 'ymjvznckbrownfox' k = 3 inStr = 'ymjvznhkbrownfox' k = 11 inStr = 'ymjvznhpbrownfox' k = 2 inStr = 'ymjvznhpgrownfox' k = 18 inStr = 'ymjvznhpgwownfox' k = 15 inStr = 'ymjvznhpgwtwnfox' k = 23 inStr = 'ymjvznhpgwtbnfox' k = 14 inStr = 'ymjvznhpgwtbsfox' k = 6 inStr = 'ymjvznhpgwtbskox' k = 15 inStr = 'ymjvznhpgwtbsktx' k = 24 inStr = 'ymjvznhpgwtbsktc' outStr = 'ymjvznhpgwtbsktc'

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

bcc = 'abcdefghijklmnopqrstuvwxyz' k = 20 inStr = 'phecrowfliesatmidnight' k = 8 inStr = 'pdecrowfliesatmidnight' k = 5 inStr = 'pdacrowfliesatmidnight' k = 3 inStr = 'pdayrowfliesatmidnight' k = 18 inStr = 'pdaynowfliesatmidnight' k = 15 inStr = 'pdaynkwfliesatmidnight' k = 23 inStr = 'pdaynksfliesatmidnight' k = 6 inStr = 'pdaynksbliesatmidnight' k = 12 inStr = 'pdaynksbhiesatmidnight' k = 9 inStr = 'pdaynksbheesatmidnight' k = 5 inStr = 'pdaynksbheasatmidnight' k = 19 inStr = 'pdaynksbheaoatmidnight' k = 1 inStr = 'pdaynksbheaowtmidnight' k = 20 inStr = 'pdaynksbheaowpmidnight' k = 13 inStr = 'pdaynksbheaowpiidnight' k = 9 inStr = 'pdaynksbheaowpiednight' k = 4 inStr = 'pdaynksbheaowpieznight' k = 14 inStr = 'pdaynksbheaowpiezjight' k = 9 inStr = 'pdaynksbheaowpiezjeght' k = 7 inStr = 'pdaynksbheaowpiezjecht' k = 8 inStr = 'pdaynksbheaowpiezjecdt' k = 20 inStr = 'pdaynksbheaowpiezjecdp' outStr = 'pdaynksbheaowpiezjecdp'