I am a big LISP-Newb and am struggling with a program that is supposed to encrypt a string with Caesar's cipher. What I have in mind is a function that takes in 2 arguments: a string and a number to specify the modulus. Something along the lines:
(defun c-encrypt (string number)
("lots of helper functions"))
My thoughts so far are that it would be best to set the alphabet as a parameter and write a function that looks up a chars position in the parameter and then shifts it the wanted Caesar's modulo to the right e.g. A ->modulo 7 -> H
May look something along the lines:
(defun shift (char x) (char *alphabet* (mod(+24 x"being the wanted modulo")27)))
Well, I ran headfirst into a lot of problems. First of all, I can not find a function to split a string into its single chars (convert it to numbers fine, but simply split it...). If I could somehow split the string into its single characters and make a list out of them my first problem would be solved. When trying to concatenate there are always these darn #\ left which make it impossible to use the parameter.
As you see I already fail at the first obstacle of the whole project...
Not to speak about the rest...
Any help would be greatly appreciated since I really start to get frustrated about this project and LISP itself. For some reason I find it extremely difficult to "think LISP".
Thanks already for your answers!