Addition/Subtraction cipher
Statement
Given an encrypted message [[m]], decrypt it and output the result.
Each word in the message is encrypted separately. Each encrypted word consists of three parts:
- the word, encrypted
- a symbol "-" or a "+", denoting which direction you need to shift the ascii values of the word
- the key, which tells you how much to shift the ascii values of the word
The key can be in one of two formats:
- a single integer or character, where the all characters in the message are either shifted by the integer or the ascii value of the character
- a list of comma separated integers or characters of equal length to the word which shift each corresponding letter by either the integer amount or ascii value of the character
Input description
A single line [[m]] of space separated encrypted words.
Output description
The decrypted message.
Constraints
Characters used in decryption process ("+", "-", comma, space) will never appear in the words or as the key. All integer values in the keys are to be interpreted literally, not as their ascii values.
Game modes
Test cases
Greetings, universe Test
Input
Jgnnq-2 VmjCa+1,2,8,),3
Output
Hello World
Validator 1 Validator
Input
Nqi+6 opxn}K-24,1,6,10,10,*
Output
Two Words!
Simple Test
Input
K`-6 OQPG[#-2
Output
EZ MONEY!
Validator 2 Validator
Input
[fqnifytw-5 Z}u-6
Output
Validator Two
Could be edgy Test
Input
\O:4@c(NJ!+34,38,20,53,3,12,J,32,),0
Output
~uNiCorns!
Validator 3 Validator
Input
b|zvyL{xx~-A,9,12,4,10,9,18,*,3,0
Output
!snroCiNu~
Obligatory lorem ipsum Test
Input
(KNAI+36 lsvxp-3 [<0FH+9,51,<,),* vwz-3,14,6 ium|4-8 mypuj}~l{ys-10,10,2,2,5,26,10,7,7,4,1 .16=6@06;4+51 _fcn(+6 vjxfy{z-32,1,2,5,12,6,7 <2=+55 FRJY+27 %PP:U>+N,17,32,/,16,48 zip-4 tbqjfo-1 KJhYQCQ+33,23,7,25,20,34,35 M;ACNNCM+38 xkvcg-2 rn-9,10 wz}px9-11 Qv|momz-8 qe|mqyw0-4 tsvxqy-8,10,15,3,5,24 '(+B,F gsqqshs-4 joiz{s2-6 [^_+24,7,14 P3b=\+32,B,16,56,23 zksvux-6 ~nwx}A-17,9,3,3,10,21 =o9(g.=+*,3,40,N,2,54,36 wzy~z{{-10,25,1,21,13,6,8 `>_J@+13,35,8,36,33 gxi{-6 &^#+H,17,K h{1-3 /nB?U+21,1,44,38,14 {z-6 8:774>+53 41EQ.g"+56,52,30,35,G,12,12
Output
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sit amet sapien vel sapien laoreet sagittis vitae id lorem. Integer maximus, ligula in commodo dictum, sem purus tempor metus, gravida maximus magna arcu non ex. Donec ut mollis lectus.
Validator 4 Validator
Input
7IH+28 ~z-9,6 tm|t||xrwxy~-4,8,10,1,12,19,21,9,22,4,16,11 }}ok-8,15,11,6 wuvq{-8 pw|r-7,4,8,13 pf}|t-2,5,9,7,1 f}vsu-1,11,4,4,3 zp{-7 KDAJEI6I:B+43 izu~{m}~}{{-8,23,18,9,8,12,15,10,20,6,14 TecQXcHVO'+16,10,9,30,26,2,37,27,38,> B@/0?H#`U]*+*,33,F,52,34,38,Q,9,32,16,2 \W\IU+24 uhp-3 Xg\i`Xd#+9 _[ko_+6 U\_M+20 y}im-8 ~w-29,21 NQQT+27 FmEDVF=Fc+35,1,49,33,24,.,50,44,2 `O\S^K^S]+22 |v-23,2 txdvl-3 Zk\abm^\mh+7 Z&*U'$+8,?,55,31,:,A DG;'G+50,34,57,:,30 I]S(C+27,12,16,L,30 jlek+9 q}sxzsrh{8-12,5,3,12,17,16,17,6,12,10 !`'d+45,5,F,11 oxsw-10 MJFEK+28,38,45,28,34 =:b:c<Rg.'+57,53,10,;,13,56,15,13,55,F uyme2-4
Output
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia.
Solution language
Solution
Stub generator input