# this implements a very basic Stroop task using PsychoPy
# see https://en.wikipedia.org/wiki/Stroop_effect for more details

from psychopy import visual, core

screen = visual.Window([800, 600], color='black', units='pix')
fixation = visual.TextStim(screen, text='+', color='white', height=50)

text1 = visual.TextStim(screen, text='RED', color='green', height=50)
text2 = visual.TextStim(screen, text='GREEN', color='blue', height=50)
text3 = visual.TextStim(screen, text='BLUE', color='red', height=50)

fixation.draw()
screen.flip()
core.wait(0.5)

text1.draw()  # present the word RED, in the color green
screen.flip()
core.wait(0.5)

fixation.draw()
screen.flip()
core.wait(0.5)

text2.draw() # present the word GREEN, in the color blue
screen.flip()
core.wait(0.5)

fixation.draw()
screen.flip()
core.wait(0.5)

text3.draw() # present the word BLUE, in the color red
screen.flip()
core.wait(0.5)

screen.close()
core.quit()
