Project

stroop

0.0
Low commit activity in last 3 years
No release in over a year
The Stroop effect - demonstrating the interference in the reaction time of a task.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0
~> 3.0

Runtime

~> 1.0
~> 1.0
 Project Readme

Stroop [version] Build Status

Stroop is a tiny CLI for printing Stroop tests in order to experience the psychological Stroop effect.

The Stroop effect demonstrates the interference in the reaction time of a task. The CLI prints a number of color words in 3 different stimuli:

  1. Neutral: each words is written in the same color (black)
  2. Congruent: the text color and the word refer to the same color
  3. Incongruent: the text color and the word do not refer to the same color

Setup

Install the gem with:

gem install stroop

Usage

In the terminal type:

# printing a neutral stimuli
# (text displayed in one color):
$ stroop neutral 5x10

# printing congruent stimuli
# (text color and word refer to the same color):
$ stroop congruent 5x10

# printing incongruent stimuli
# (text color and word do not refer to the same color):
$ stroop incongruent 5x10

This will print you a Stroop test of 10 lines of words with 5 words in each of them.

You can adjust the rows and columns of words by changing the CxR param as you like (e.g. 5x2). If you leave it out a default of 5x10 is used.

For each print out you will find the random seed that was used to generate the color words.

You can also pass a seed by using the --seed or -s option:

$ stroop neutral --seed=1234
$ stroop congruent -s 1234
$ stroop incongruent -s 1234

If you want to use Stroop in Ruby you can run the following code:

require 'stroop'

# adjust rows and columns to whatever you like
set = Stroop::Set.new(columns: 5, rows: 10, mode: Stroop::Set::NEUTRAL)
set.to_s # => returns the string of colorized words

# or if you want to pass a specific random seed that is used to generate the set:
set = Stroop::Set.new(columns: 5, rows: 10, mode: Stroop::Set::NEUTRAL, seed: 1234)
set.seed # => returns the random seed that was used to create the color words

The available Stroop::Set modes are:

Stroop::Set::NEUTRAL     # => :neutral
Stroop::Set::CONGRUENT   # => :congruent
Stroop::Set::INCONGRUENT # => :incongruent

MIT License

Copyright (C) 2015 Paul Götze. Released under the MIT license.