Google Answers Logo
View Question
 
Q: simple help ( No Answer,   0 Comments )
Question  
Subject: simple help
Category: Computers > Programming
Asked by: mott85-ga
List Price: $25.00
Posted: 30 Nov 2004 19:18 PST
Expires: 01 Dec 2004 22:20 PST
Question ID: 436398
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?
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy