I'm setting up a cognitive experiment for a professor using jsPsych, where the stimuli are about 200 logical statements of the form T ∧ F ∨ T with 4 different spacing types. I need to find a way to generate every combination of three truth values, two logical operators, and four spacing types, written in the correct order, without typing them all in by hand (hopefully).
The specifics are as follows:
Spacing types (where -- represents a space):
1) T∧T∨T i.e. no space, 2) T∧--T∨T, 3) T∧T--∨T, 4) T∧--T--∨T
Operators:
1) ∧ ∧ , 2) ∨ ∨ , 3) ∧ ∨ , 4) ∨ ∧
Truth Values:
All 3-combinations of T and F (There are 8). Ex: T T T, T T F, F T F, F F F, etc.
So I need to go through all combinations of these three things, putting them together into strings (written in html), and generating a list or array with all of the strings in it (there are about 200). I'm fairly new to cs so any help is appreciated with this problem, it's just too many moving pieces for me!
note Thanks to a commenter for pointing out that I didn't include things I've tried.
I've been trying this for a while using 3-5 nested for-loops. I initially set up an array of size 7 (as that is the longest possible length of a string) and using the for loops to fill in the spaces of the array. I have been almost completely unsuccessful using this route. It seems promising enough and maybe I can get it to work but it is also very inelegant and long and I'm wondering now if there is a more straightforward way to do this. Again, as I'm new to this there may be resources I'm unaware of.
Thanks!