Search found 4 matches

by kelvin
Tue Aug 17, 2010 4:50 am
Forum: Scheme
Topic: Need help in displaying using lists
Replies: 6
Views: 16928

Re: Need help in displaying using lists

Ops sorry the calling should be (permutate '(1 2 3) 2), with the 2nd parameter being a number, where it will determine the number of permutates.
by kelvin
Tue Aug 17, 2010 4:47 am
Forum: Scheme
Topic: Need help in displaying using lists
Replies: 6
Views: 16928

Re: Need help in displaying using lists

Thanks for all the help. I have worked out a solution on my own, and it is some what similar. Here's my solution to share: (define (permutate lst len) (cond ((= 0 len) '(())) (else (append-map (lambda (x) (map (lambda (y) (reverse (cons y x ))) lst)) (permutate lst (- len 1)))))) And similarly i do ...
by kelvin
Fri Aug 06, 2010 10:42 am
Forum: Scheme
Topic: Need help in displaying using lists
Replies: 6
Views: 16928

Re: Need help in displaying using lists

Hi thanks for the reply. But actually i can't use the function in mention. Hmmm, what i would like to do is to produce a permutation. Let's take alphabets for a-z for example. When I call my function (permutate n): (permutate 1) output: (("a")("b")("c")....("x"...
by kelvin
Wed Aug 04, 2010 6:38 am
Forum: Scheme
Topic: Need help in displaying using lists
Replies: 6
Views: 16928

Need help in displaying using lists

Hi mates, I'm trying to produce and algorithm that counts (base 10) and display in such a manner: Numbers 0 to 9 will produce this output: ((0)(1)(2)(3).....(8)(9)) Numbers 10 to 20 will produce this ouput: ((00)(01)(02)...(09)(10)(11)...(20)) The thing is each time the number gets larger, I would l...