Cody

# Problem 44351. Code breaker, Part I: Operation Phoenix

Solution 1937590

Submitted on 16 Sep 2019
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
% This test suite can be updated if inappropriate 'hacks' % are discovered in any submitted solutions, % so your score/size may therefore change over time.

2   Fail
x = 'Dbodfm Pqfsbujpo Qipfojy jnnfejbufmz & ftdbqf.'; s_correct.shift = 1; s_correct.message = 'Cancel Operation Phoenix immediately & escape.'; s = decode(x); assert( isequal(s.shift, s_correct.shift) ) assert( isequal(s.message, s_correct.message) ) assert( isequal(class(s.shift), 'uint8') ) assert( isequal(class(s.message), 'char') )

s = struct with fields: shift: 2 message: 'Cancel Operation Phoenix immediately & escape.' s = struct with fields: shift: 2 message: 'Cancel Operation Phoenix immediately & escape.'

Assertion failed.

3   Fail
x = 'Vwlyhapvu Wovlupe ilnpuz Ablzkhf! Vwlyhapvu Wovlupe pz vby avw wypvypaf.'; s_correct.shift = 7; s_correct.message = 'Operation Phoenix begins Tuesday! Operation Phoenix is our top priority.'; s = decode(x); assert( isequal(s.shift, s_correct.shift) ) assert( isequal(s.message, s_correct.message) ) assert( isequal(class(s.shift), 'uint8') ) assert( isequal(class(s.message), 'char') )

s = struct with fields: shift: 8 message: 'OperaZion Phoeni^ begins Z[esda_! OperaZion Phoeni^ is o[r Zop prioriZ_.' s = struct with fields: shift: 8 message: 'OperaZion Phoeni^ begins Z[esda_! OperaZion Phoeni^ is o[r Zop prioriZ_.'

Assertion failed.

4   Fail
x = 'Eatpht cdit iwpi iwt ephhldgs wph qttc rwpcvts ugdb "Fxeudyn" id "Dvcsbwl". Diwtglxht Detgpixdc Ewdtcxm xh egdrttsxcv prrdgsxcv id eapc.'; s_correct.shift = 15; s_correct.message = 'Please note that the password has been changed from "Qipfojy" to "Ogndmhw". Otherwise Operation Phoenix is proceeding according to plan.'; s = decode(x); assert( isequal(s.shift, s_correct.shift) ) assert( isequal(s.message, s_correct.message) ) assert( isequal(class(s.shift), 'uint8') ) assert( isequal(class(s.message), 'char') )

s = struct with fields: shift: 16 message: 'VReaYe TUZe ZhaZ Zhe VaYY]UXd haY beeT chaTged fXUS "WiVfUj_" ZU "UgTdSh]". UZheX]iYe UVeXaZiUT VhUeTi^ iY VXUceediTg accUXdiTg ZU VRaT.' s = struct with fields: shift: 16 message: 'VReaYe TUZe ZhaZ Zhe VaYY]UXd haY beeT chaTged fXUS "WiVfUj_" ZU "UgTdSh]". UZheX]iYe UVeXaZiUT VhUeTi^ iY VXUceediTg accUXdiTg ZU VRaT.'

Assertion failed.

5   Fail
x = 'Mncpyrgml Nfmclgv qryprcb rfpcc bywq yem. Yjj ncpqmllcj ypc rm pckygl ml bsrw slrgj Mncpyrgml Nfmclgv gq amknjcrcb.'; s_correct.shift = 24; s_correct.message = 'Operation Phoenix started three days ago. All personnel are to remain on duty until Operation Phoenix is completed.'; s = decode(x); assert( isequal(s.shift, s_correct.shift) ) assert( isequal(s.message, s_correct.message) ) assert( isequal(class(s.shift), 'uint8') ) assert( isequal(class(s.message), 'char') )

s = struct with fields: shift: 25 message: 'UVKXaZOUT VNUKTO^ YZaXZKJ ZNXKK Ja_Y aMU. ARR VKXYUTTKR aXK ZU XKSaOT UT J[Z_ [TZOR UVKXaZOUT VNUKTO^ OY IUSVRKZKJ.' s = struct with fields: shift: 25 message: 'UVKXaZOUT VNUKTO^ YZaXZKJ ZNXKK Ja_Y aMU. ARR VKXYUTTKR aXK ZU XKSaOT UT J[Z_ [TZOR UVKXaZOUT VNUKTO^ OY IUSVRKZKJ.'

Assertion failed.

6   Fail