I'm new to lisp and am trying to create a simple word scramble program. Eventually it will read in a text file and scramble the words leaving the first and last letter of each word intact.
for the first part I'm trying to create a function that takes a word and only scrambles the middle letters.
for the first part I'm trying to create a function that takes a word and only scrambles the middle letters.
(defun scramble (word)
(if (< (length word) 4) ; word must be 4 letters long in order for this to work
; below is where i need help with rearranging the middle part between first and last letters.
word (append (list (first word) ....need help here.... (last word))
then I need to read in a text file of words that will take each word separated by a space or dash and run the scramble function of them. here is what i have thus far to just read in the file.
(let ((in (open (stream filename)
(do ((char (read-char stream nil)))
(word nil))
any help would be greatly appreciated