This repository provides a digital implementation of the Corsi Block-Tapping Test, a well-established neuropsychological task used to assess visuospatial working memory.
The implementation is designed to be:
- experimentally sound
- reproducible
- suitable for research and educational use
The task is implemented in Python using Pygame and supports both Forward and Backward variants within a single codebase.
In the Corsi Block-Tapping Test, a sequence of spatially distributed blocks is presented to the participant.
After the presentation, the participant must reproduce the sequence by clicking on the blocks.
- The sequence must be reproduced in the same order as presented.
- The sequence must be reproduced in reverse order.
The two versions share the same stimulus presentation and differ only in the response rule.
- Number of blocks: 9
- Starting span: 2
- Span increases by 1 after successful completion
- Each span consists of 2 independent trials
- If both trials are incorrect, the task terminates
- Maximum response time per trial: 10 seconds
- Visual feedback is provided after each trial
- An acoustic cue marks the transition from stimulus to response phase
- Blocks are highlighted sequentially during stimulus presentation
- During the response phase, blocks briefly highlight on click
- The same block can be clicked multiple times during a response
- The task runs in fullscreen mode for controlled visual presentation
For each trial, results are saved to a CSV file with trial-level granularity.
subject_idmode(forward/backward)spantrialsequence_shownsequence_responsecorrecttimestamp
Example filename:
ABCDEF_corsi_forward_results.csv
Sequences are stored using the | separator (e.g. 2|5|7) to avoid automatic date conversion issues in spreadsheet software such as Microsoft Excel.
Result files are intentionally excluded from version control.
- Python ≥ 3.8
- pygame
- numpy
Install dependencies:
pip install pygame numpy
Run the task:
python corsi_block_tapping_test.py
To switch between Forward and Backward versions, modify the MODE variable in the code:
MODE = "forward" # or "backward"
An audio cue (start.wav) is played before the response phase to clearly signal task onset.
The audio file is included in the repository.
Spreadsheet software such as Microsoft Excel may automatically convert certain strings into dates.
To prevent this, sequences are stored using a non-date separator (|).
- Corsi, P. M. (1972). Human memory and the medial temporal region of the brain.
- Kessels, R. P. C., et al. (2000). The Corsi Block-Tapping Task: Standardization and normative data.
If you use this implementation in academic research, experiments, or publications,
please cite this repository as follows:
Di Cesare, M.G.
Digital Corsi Block-Tapping Test (Forward & Backward).
GitHub repository.
https://github.com/mgdicesare/corsi-block-tapping-test
Proper citation ensures reproducibility and acknowledges the original implementation.
This project is intended for research and educational purposes.