List Work 
Author Message
 List Work

Hi, List!

   I am new to working with lists.  A short experiment in MSWLogo
follows:

   Make noun [ boy girl dog cat ]
   Make verb  [runs sings howls scratches ]

make "a last :noun
make "b first :verb
print  ( se "The  :a :b   "everyday ".)

    The cat runs everyday.

   My question is, How would one randomly access various members of
each list so that a variety of sentences are generated?  ( I had
problems using Random as the Item # generator since 0 is no good.
Would I make the new number the generated number plus 1, or is there
something more "elegant"? )

   Thanks for any help you can send!

                                                  Sincerely,
                                                     Tom

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Sat, 09 Mar 2002 03:00:00 GMT  
 List Work

Quote:

>   My question is, How would one randomly access various members of
>each list so that a variety of sentences are generated?

There is a PICK procedure in the library (so you can use it as a primitive)
that takes a list and returns a randomly chosen element.  Here's how it's
written:

    to pick :list
    output item (1+random count :list) :list
    end

[posted and mailed]



Sat, 09 Mar 2002 03:00:00 GMT  
 List Work
Thanks, Brian,

    I'll give that a try!

                                               Sincerely,
                                                   Tom



Quote:

> >   My question is, How would one randomly access various members of
> >each list so that a variety of sentences are generated?

> There is a PICK procedure in the library (so you can use it as a
primitive)
> that takes a list and returns a randomly chosen element.  Here's how
it's
> written:

>     to pick :list
>     output item (1+random count :list) :list
>     end

> [posted and mailed]

Sent via Deja.com http://www.deja.com/
Before you buy.


Tue, 12 Mar 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. LOGO-L> List Work

2. VWNC mailing list working now

3. Help: how to make shift-click on a List work like standard window style i.e. select a range

4. Jobs, Jobs, Jobs, Work, Work, Work

5. vwnc mailing list not working?

6. --HELP-- Subcanvas LIST BOX doesn't work now

7. POST(EVENT:Scrolldown,?List)doesnt work

8. ?List{prop:hscrollpos} not working?

9. Drop Down List boxes don't work-CW2.003

10. List box in source procedure - Up and Down Key not work

11. SelectWhoeRecord for List box not working--HELP

12. Hotkeys (F2-F9) for menu doesnt work in browse-list

 

 
Powered by phpBB® Forum Software