chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Chase's Sequence - syntax fixes, examples, anagram index


From: metaperl.j
Subject: [Chicken-users] Chase's Sequence - syntax fixes, examples, anagram index
Date: Fri, 16 Nov 2007 15:35:14 -0000

1 - Mario fixed the code for Chase's Sequence -
http://galinha.ucpel.tche.br:8080/Chase%20Sequence -
so that it compiles - http://paste.lisp.org/display/50948#1

It had some parenthesis issues. Probably best to update the wiki with the
fixed version.

2 - Could some typical usage examples of this be added?

3 - My goal is to be able to return a unique whole number indicating which
permutation of n items was input. For example, given 3 items, there are 6
permutations. And (iota 6) are the numbers which should be returned for each
of the permutations:

0 1 2  => 0
0 2 1  => 1
1 0 2  => 2
1 2 0  => 3
2 0 1  => 4
2 1 0  => 5

(anagram-index '(1 2 0)) ; => 3

I found some naive scheme code to do this -
http://paste.lisp.org/display/11447, but am not sure if Chase's Sequence
will be useful to do this more efficiently.


-- 
View this message in context: 
http://www.nabble.com/Chase%27s-Sequence---syntax-fixes%2C-examples%2C-anagram-index-tf4822025.html#a13795478
Sent from the chicken-users mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]