Hi Meg,
While I don’t have an example that works exactly like the test you referenced, the Simon experiment that I wrote for you last year is a good starting point.
Like the buttons in that experiment, each square in the new one would be a fixation point. To support a variable number of squares, you’ll need to create enough fixation points to handle the maximum number of squares, but queue and display only the desired number at each step in the test. You would detect button presses using a touch input device.
Maybe you can take a shot at implementing this, using the Simon experiment as a guide, and let me know if you have trouble with any of the details?
Cheers,
Chris