Discussion:
recursive and 'prog'
ÿffffe7aÿfffff0layan
2007-11-01 16:24:16 UTC
Permalink
I want to write a function using recursive function,
which prints the first let's say 15 cubes (1, 8, 27,
64..). H o w ?

How could it be with non-recursive function?

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Emre Sevinc
2007-11-01 17:09:08 UTC
Permalink
-----Original Message-----
From: cs-lisp-***@cs.bilgi.edu.tr on behalf of aykut "ÿffffe7aÿfffff0layan
Sent: Thu 11/1/2007 6:24 PM
To: lisp grup
Subject: [cs-lisp] recursive and 'prog'
Post by ÿffffe7aÿfffff0layan
I want to write a function using recursive function,
which prints the first let's say 15 cubes (1, 8, 27,
64..). H o w ?
How could it be with non-recursive function?
Merhaba Aykut,

Cok basit bir ornek p vereyim:

[2] CL-USER(5): (mapcar (lambda (x) (* x x)) '(1 2 3))
(1 4 9)

Baska bir ornek:

[3] CL-USER(8): (mapcar (lambda (x) (* x x)) (loop for i from 1 to 5 collect i))
(1 4 9 16 25)

Bunlar bir fikir verdi mi?

Bu ornekler ozyineli (recursive) degillerdi.

Bunlara dayanarak 0'dan buyuk ilk 15 kup sayiyi ureten fonksiyonu yazmayi deneyebilir misin?


--
Emre Sevinc

Loading...