# Shaurya Baranwal Valentine Homework due February 14, 2024 # OK to post with(plots): CC:=proc(p, k_) local A_, T_, i_: A_ := ['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 i_ from 1 to nops(A_) do T_[A_[i_]] := A_[(i_+k_-1 mod 26) + 1]: od: [seq(T_[p[i_]], i_=1..nops(p))]: end: text1 := ['I']: text2 := ['L', 'O', 'V', 'E']: text3 := ['C', 'O', 'D', 'I', 'N', 'G']: text4 := ['T', 'H', 'E', 'O', 'R', 'Y']: ciphertext1 := CC(text1, 19): ciphertext2 := CC(text2, 19): ciphertext3 := CC(text3, 19): ciphertext4 := CC(text4, 19): message := [ciphertext1, ciphertext2, ciphertext3, ciphertext4]: encrypted := "": for m in message do for c in m 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=["times", "roman", 24]);