#define SS_EXP_C
#include "ss_trial.c"
int subj;
int sex;
void info()
{
int x;
do {
ts_clrscr();
x = ts_printf(-ax(.9), ay(.9), "Participant number (0-19): ");
ts_scanf(-ax(.9) + x, ay(.9), "%d", &subj);
} while (subj < 0 || subj > 19);
char tmp;
do {
ts_clrscr();
x = ts_printf(-ax(.9), ay(.9), "sex (m/v): ");
ts_scanf(-ax(.9) + x, ay(.9), "%c", &tmp);
} while (tmp != 'm' && tmp != 'v');
if (tmp == 'm')
sex = 0;
else
sex = 1;
ts_clrscr();
}
void instructions1()
{
ts_clrscr();
ts_printf_centre(0, ay(.5), "practice");
if (data[0].task == COLOR)
ts_printf_centre(0, ay(.16), "COLOR relevant");
else
ts_printf_centre(0, ay(.16), "MEANING relevant");
if (data[0].respmap == RR)
ts_printf_centre(0, -ay(.16), "red right - green left");
else
ts_printf_centre(0, -ay(.16), "red left - green right");
ts_button(0, -ay(.5));
ts_clrscr();
}
void instructions2()
{
ts_clrscr();
ts_printf_centre(0, 0, "and now for real ...");
ts_button(0, -ay(.5));
ts_clrscr();
}
void bye()
{
ts_clrscr();
ts_printf_centre(0, 0, "That's all. Thanks.");
ts_button(0, -ay(.5));
ts_clrscr();
}
int main()
{
ts_scrsize(XGA);
ts_scrmode(FULLSCREEN);
ts_font(COURIER, 20, BOLD);
ts_defkey(M1);
ts_defkey(M2);
ts_defkey(KEY_ESC);
info();
randomize(subj, sex);
int i;
instructions1();
for (i = 0; i < NPRACT; i++)
trial(i);
instructions2();
for (; i < NTRIALS; i++)
trial(i);
writedata();
bye();
return 0;
}
END_OF_MAIN();