Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
3
Task/Repeat-a-string/Common-Lisp/repeat-a-string-1.lisp
Normal file
3
Task/Repeat-a-string/Common-Lisp/repeat-a-string-1.lisp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(defun repeat-string (n string)
|
||||
(with-output-to-string (stream)
|
||||
(loop repeat n do (write-string string stream))))
|
||||
9
Task/Repeat-a-string/Common-Lisp/repeat-a-string-2.lisp
Normal file
9
Task/Repeat-a-string/Common-Lisp/repeat-a-string-2.lisp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(defun repeat-string (n string
|
||||
&aux
|
||||
(len (length string))
|
||||
(result (make-string (* n len)
|
||||
:element-type (array-element-type string))))
|
||||
(loop repeat n
|
||||
for i from 0 by len
|
||||
do (setf (subseq result i (+ i len)) string))
|
||||
result)
|
||||
2
Task/Repeat-a-string/Common-Lisp/repeat-a-string-3.lisp
Normal file
2
Task/Repeat-a-string/Common-Lisp/repeat-a-string-3.lisp
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(defun repeat-string (n string)
|
||||
(format nil "~V@{~a~:*~}" n string))
|
||||
1
Task/Repeat-a-string/Common-Lisp/repeat-a-string-4.lisp
Normal file
1
Task/Repeat-a-string/Common-Lisp/repeat-a-string-4.lisp
Normal file
|
|
@ -0,0 +1 @@
|
|||
(princ (repeat-string 5 "hi"))
|
||||
1
Task/Repeat-a-string/Common-Lisp/repeat-a-string-5.lisp
Normal file
1
Task/Repeat-a-string/Common-Lisp/repeat-a-string-5.lisp
Normal file
|
|
@ -0,0 +1 @@
|
|||
(make-string 5 :initial-element #\X)
|
||||
Loading…
Add table
Add a link
Reference in a new issue