Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: "MWForum" <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: running the procedures in random order
From: "Mike Sandy" <mjsandy@xxxxxxxxxxxxxx>
Date: Wed, 7 Feb 2007 11:53:00 -0000

Given a list of procedure names: [p1 p2 p3....],
if you want random choice including repetitions
then: RUN (list pick [p1 p2 ....])
If you do not want the repetitions, one way is to shuffle the
list and take the items in sequence from the list.
E.G. Given a textbox: TEXT1

to p1
 show "r1
end
to p2
 show "r2
end
to p3
 show "r3
end

to p4
 show "r4
end

to begin
 cc
 ct pr shuffle [p1 p2 p3 p4]
end

to go
 let[p parse text1]
 run (list first :p)
 if empty? bf :p
  [ct pr shuffle prog.list stop]
 ct pr bf :p
end

to shuffle :list
 if empty? :list[op[]]
 let[i pick :list]
 op fput :i shuffle remove.item :i :list
end

to remove.item :i :list
 if empty? :list[op[]]
 if :i = first :list[op bf :list]
 op fput first :list remove.item :i bf :list
end

Mike
  ----- Original Message ----- 
  From: zehava wizman 
  To: help MW 
  Sent: Tuesday, February 06, 2007 7:44 AM
  Subject: [MWForum] running the procedures in random order


  Is ther a way to run procedures in randomally way?
                        thanks, Zehava


------------------------------------------------------------------------------
  Finding fabulous fares is fun.
  Let Yahoo! FareChase search your favorite travel sites to find flight and
hotel bargains.

  • Previous by thread: Re: running the procedures in random order
  • Next by thread: Re: running the procedures in random order

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008