I am trying to obtain the follwing out in scheme.
(define a '(0 1 2 3 4 5 6 7 8 9))
set! a (rearrange a))
Would equal= (3 9 4 7 0 6 1 8 5 2)
Basically it is removing evry third object |
Request for Question Clarification by
leapinglizard-ga
on
30 Nov 2004 19:42 PST
It doesn't look to me like you're removing every third object from the
list. The first three objects would be 2, 5, 8 and not 3, 9, 4. I
don't see what it is you want to accomplish. 3 is the fourth item in
the list, while 9 is the tenth. Could you please describe the
transformation that the rearrange procedure is supposed to carry out?
leapinglizard
|
Clarification of Question by
mott85-ga
on
30 Nov 2004 20:03 PST
You are correct i should of decribed what i was looking for more
clearly. What i am trying to accomplish is this. I basically want to
use an auxiliary function, to rearrange steps through the list and
remove every third object from the list and put it in a new list that
it is building. (menaing starting with count zero so i guess you could
3 is actually in position 3 but is the fourth item in.)
It will continue to do this. i am thinking a cddring down procedure.
It would find i suppoose the foruth item build a new list the order in
the new list doesn't matter. So here is what i am trying.
(define a '(0 1 2 3 4 5 6 7 8 9))
set! a (rearrange a))
Would equal= (3 9 4 7 0 6 1 8 5 2)
2nd iteration
(set! a (rearrange a))
Would equal=
(7 2 0 8 3 1 9 5 6 4)
I hope that makes a little more sense.
|
Request for Question Clarification by
leapinglizard-ga
on
30 Nov 2004 20:14 PST
I'm afraid it doesn't. It's obvious that you're making a new list from
the old list, but I don't see in what order you take the elements.
First you skip three elements to get the 3, then five elements to get
the 9, then four to get the 4, then two to get 7, ... I mean, what is
going on here?
leapinglizard
|
Clarification of Question by
mott85-ga
on
30 Nov 2004 20:18 PST
Ok i see your point. I apolgize for having to have all these
calrifications. I didn't think through all the way. What i am overall
trying to accomnplish is raqndom lists. So i picked 3rd postion as a
starting to start the randomization but evry itertion afer the first
should be random but i wnated the intial iertion to be postion 3 when
starting at 0 I hope this can be done.
|
Clarification of Question by
mott85-ga
on
30 Nov 2004 20:18 PST
Ok I see your point. I apologize for having to have all these
clarifications. I didn't think through all the way. What I am overall
trying to accomplish is random lists. So I picked 3rd position as a
starting to start the randomization but every iteration after the
first should be random but i wanted the initial iteration to be
position 3 when starting at 0 I hope this can be done.
|
Clarification of Question by
mott85-ga
on
01 Dec 2004 07:46 PST
Does the calrification help?
|