diff options
| author | E7-87-83 <fungcheokyin@gmail.com> | 2020-10-05 07:27:14 +0800 |
|---|---|---|
| committer | E7-87-83 <fungcheokyin@gmail.com> | 2020-10-05 07:27:14 +0800 |
| commit | ef9ac81609cd0dc26e418fe59bdf7c01899ad3ed (patch) | |
| tree | 19325ea93189b9e54d6f3caf8c83a9a89f3f6420 | |
| parent | ab2dc3767cce38fc725af97023ccd17ebce13c79 (diff) | |
| download | perlweeklychallenge-club-ef9ac81609cd0dc26e418fe59bdf7c01899ad3ed.tar.gz perlweeklychallenge-club-ef9ac81609cd0dc26e418fe59bdf7c01899ad3ed.tar.bz2 perlweeklychallenge-club-ef9ac81609cd0dc26e418fe59bdf7c01899ad3ed.zip | |
submit Lisp soln for Task 1
| -rw-r--r-- | challenge-080/cheok-yin-fung/common-lisp/ch-1.lsp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-080/cheok-yin-fung/common-lisp/ch-1.lsp b/challenge-080/cheok-yin-fung/common-lisp/ch-1.lsp new file mode 100644 index 0000000000..905c8b6d4c --- /dev/null +++ b/challenge-080/cheok-yin-fung/common-lisp/ch-1.lsp @@ -0,0 +1,14 @@ +; The Weekly Challenge - Perl & Raku #080 Task 1 Smallest Positive Integer +; Common Lisp script + +(setf arr (list 1 8 -1) ) +(setf *N* (length arr)) +(setf int-seq (list (+ *N* 1))) + +(dotimes (i *N*) + ( push (- *N* i) int-seq) ) ; int-seq == 1, 2, 3, 4, .. N+1 + +(format t "Given a list:" ) +(print arr) +(format t ", the smallest positive integer hasn't appeared:") +(print (nth 0 (set-difference int-seq arr))) |
