# OK to post homework # Alex Varjabedian, 10-Feb-2024, Homework Valentine Help := proc() print(`CC(p, shift)`) end: with(plots): CC:=proc(p, shift) local alphabet, T1, idx: alphabet := ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']: for idx from 1 to nops(alphabet) do T1[alphabet[idx]] := alphabet[(idx+shift-1 mod 26) + 1]: od: [seq(T1[p[idx]], idx=1..nops(p))]: end: message1 := ['I']: message2 := ['L', 'O', 'V', 'E']: message3 := ['C', 'O', 'D', 'I', 'N', 'G']: message4 := ['T', 'H', 'E', 'O', 'R', 'Y']: ciphertext1 := CC(message1, 19): ciphertext2 := CC(message2, 19): ciphertext3 := CC(message3, 19): ciphertext4 := CC(message4, 19): encrypted := "": for ct in [ciphertext1, ciphertext2, ciphertext3, ciphertext4] do for c in ct do encrypted := cat(encrypted, c) od: encrypted := cat(encrypted, " "): od: encrypted := substring(encrypted, 1..length(encrypted)-1): heart := plot([16*(sin(t))^3, 13*cos(t) - 5*cos(2*t) - 2*cos(3*t) - cos(4*t), t = 0..2*Pi]): text := textplot([0, 0, encrypted]): display({heart, text}, axes=none, tickmarks=[0, 0], color="Red", font=["Script MT Bold", 22]);