# Randomize dot placement

**URL:** <https://discourse.psychopy.org/t/randomize-dot-placement/35384>\
**Category:** Builder\
**Created:** [June 14, 2023, 5:15pm UTC](https://discourse.psychopy.org/t/randomize-dot-placement/35384 "2023-06-14T17:15:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexharboun](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alexharboun/32/38104_2.png) [@Alexharboun](https://discourse.psychopy.org/u/Alexharboun)\
**Post date:** [June 14, 2023, 5:15pm UTC](https://discourse.psychopy.org/t/randomize-dot-placement/35384/1 "2023-06-14T17:15:41Z")

</div>

Hello,

I am using PsychoPy for the first time and am quite new to creating experiments in general. I am trying to create a dot probe task using the Builder view, and I was wondering how I could randomize which image a dot appear behind throughout the study.

For example, if I have 80 trials with 2 images, using the builder view, how can I make a dot appear behind the top image half the time, and behind the bottom image the other half of the time, in a mixed order?

Thank you!

---

<div class="post-metadata">

**Author:** ![JensBoelte](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jensboelte/32/9060_2.png) [@JensBoelte](https://discourse.psychopy.org/u/JensBoelte)\
**Post date:** [June 16, 2023, 8:53am UTC](https://discourse.psychopy.org/t/randomize-dot-placement/35384/2 "2023-06-16T08:53:19Z")

</div>

Hello

A simple and straightforward way is to use a condition-file. Create a column named **ypos**. Insert y-coordinates (0.25, -0.25; the actual number will depend on your screen units) in this column. Refer to **ypos** in stimulus-Property, Position argument (I used a polygon to create a dot). Don’t forget to set **set every repeat**.

![grafik](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/d/5db3a917071eab9ae520a5bade71c59e58207bab.png)

Here is the specification of the loop  
 ![grafik](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/c/d/cd388c7de8003be145212b997465de8b2e4d3bd1.png)

It randomizing the condition file, see below, and repeats it five times or 40 trials

![grafik](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/3/631ea9fb9d8c0f5418b513db139bde796924360c.png)

So to get 80 trials, you need to set **nReps** to 10.

BTW, you could specify the images in the condition file as well. But if you use only two images, it it probably not worth the effort.

Best wishes Jens
