Lisp programme to generate the following structure:
(dotimes(x (+ n 1) t)
(dotimes(y x t) (format t "*")
)
(format t "~&")
)
)
* ** *** **** ***** ******
Program:
Download Runnable Code(defun gen(n)
(dotimes(x (+ n 1) t)
(dotimes(y x t) (format t "*")
)
(format t "~&")
)
)
Output:
Break 2 [4]> (load 'ge.lsp) ;; Loading file ge.lsp ... ;; Loaded file ge.lsp T
Break 2 [4]> (gen 6) * ** *** **** ***** ******
Download
0 comments:
Post a Comment