# Randomizing order of routines within a loop

**URL:** https://discourse.psychopy.org/t/randomizing-order-of-routines-within-a-loop/16089
**Category:** Builder
**Created:** [August 31, 2020, 12:44pm UTC](https://discourse.psychopy.org/t/randomizing-order-of-routines-within-a-loop/16089 "2020-08-31T12:44:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bets](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/bets/32/13075_2.png) [@bets](https://discourse.psychopy.org/u/bets)
#### Post date: [August 31, 2020, 12:44pm UTC](https://discourse.psychopy.org/t/randomizing-order-of-routines-within-a-loop/16089/1 "2020-08-31T12:44:44Z")

</div>

Hi,  
In the experiment, I want the circles to always come in the place and color I have determined, but the order in which they are displayed is random. For example, the red circle will always be displayed at (0,3.5), the purple circle at (3.5,0), but I cannot randomize the order in which the circles will be displayed in the loop that will be repeated 4 times. How can I do that?

 ![trialprope](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/0/2/023c42d24959b44da810c6fc8cc82f4447247c63.png) ![sred](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/b/4bb9be3aee6167a600e69991a766281b35292242.png) ![Adsızcxmvx](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/5/45bcf0445fb1aa52d2755d53e71b4b8db9758e68.png)

---

<div class="post-metadata">

### Author: ![TParsons](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/tparsons/32/8301_2.png) [@TParsons](https://discourse.psychopy.org/u/TParsons)
#### Post date: [September 1, 2020, 9:24am UTC](https://discourse.psychopy.org/t/randomizing-order-of-routines-within-a-loop/16089/2 "2020-09-01T09:24:41Z")

</div>

I think what you want to do is, rather than having 4 routines and attempting to randomise between them, have 1 routine and have the properties of the objects set by a Conditions file.

So using the example values you provided, if part of your Conditions file looked like this:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/7/77ba10eaff9172cfcb0158879d1bb32883b7ee55.png)  
You would set the value of Color for the circle to `$CircleColor` and the value of Position to `CirclePosition`, that way in one trial it would be red and at `(0,3.5)` while in another it would be purple and at `(3.5,0)`.
