Hello I am looking to edit a great script made and posted by wje_1q
Here I would like to be able to save results to a txt file is this possible
#!/usr/bin/clisp
(defparameter *character-set* "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")
;(defparameter *character-set* "ABC") ; < --- this line is for testing
(defparameter *word-length* 10)
;(defparameter *word-length* 4) ; < --- this line is for testing
(defparameter *character-list*
(coerce *character-set* 'list))
(defun final-char (in-string)
(cond
((> (length in-string) 0)
(elt in-string (1- (length in-string))))
(t
nil)))
(defun new-char-list (in-string)
(let ((result))
(mapcar
(lambda (candidate)
(cond
((not (eql candidate (final-char in-string)))
(push candidate result))))
*character-list*)
(nreverse result))
)
(defun extend-string (in-string desired-length)
(mapcar
(lambda (new-char)
(let ((new-string (concatenate 'string in-string (string new-char))))
(cond
((> (length new-string) desired-length))
((>= (length new-string) desired-length)
(format t "~a~%" new-string))
(t
(extend-string new-string desired-length)))))
(new-char-list in-string)))
(extend-string "" *word-length*)
Thanks.