Cody

# Problem 751. Implement simple rotation cypher

Solution 2108660

Submitted on 28 Jan 2020 by IDAN ASULIN
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))

v = 100 111 117 103 v = 110 111 117 103 v = 110 121 117 103 v = 110 121 101 103 v = 110 121 101 113 outStr = 'nyeq'

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

v = 116 104 101 113 117 105 99 107 98 114 111 119 110 102 111 120 v = 121 104 101 113 117 105 99 107 98 114 111 119 110 102 111 120 v = 121 109 101 113 117 105 99 107 98 114 111 119 110 102 111 120 v = 121 109 106 113 117 105 99 107 98 114 111 119 110 102 111 120 v = 121 109 106 118 117 105 99 107 98 114 111 119 110 102 111 120 v = 121 109 106 118 122 105 99 107 98 114 111 119 110 102 111 120 v = 121 109 106 118 122 110 99 107 98 114 111 119 110 102 111 120 v = 121 109 106 118 122 110 104 107 98 114 111 119 110 102 111 120 v = 121 109 106 118 122 110 104 112 98 114 111 119 110 102 111 120 v = 121 109 106 118 122 110 104 112 103 114 111 119 110 102 111 120 v = 121 109 106 118 122 110 104 112 103 119 111 119 110 102 111 120 v = 121 109 106 118 122 110 104 112 103 119 116 119 110 102 111 120 v = 121 109 106 118 122 110 104 112 103 119 116 98 110 102 111 120 v = 121 109 106 118 122 110 104 112 103 119 116 98 115 102 111 120 v = 121 109 106 118 122 110 104 112 103 119 116 98 115 107 111 120 v = 121 109 106 118 122 110 104 112 103 119 116 98 115 107 116 120 v = 121 109 106 118 122 110 104 112 103 119 116 98 115 107 116 99 outStr = 'ymjvznhpgwtbsktc'

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

v = 116 104 101 99 114 111 119 102 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 104 101 99 114 111 119 102 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 101 99 114 111 119 102 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 99 114 111 119 102 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 114 111 119 102 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 111 119 102 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 119 102 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 102 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 108 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 105 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 101 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 115 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 97 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 116 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 109 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 105 105 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 105 101 100 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 105 101 122 110 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 105 101 122 106 105 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 105 101 122 106 101 103 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 105 101 122 106 101 99 104 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 105 101 122 106 101 99 100 116 v = 112 100 97 121 110 107 115 98 104 101 97 111 119 112 105 101 122 106 101 99 100 112 outStr = 'pdaynksbheaowpiezjecdp'

### Community Treasure Hunt

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

Start Hunting!