#PsyScope 1.0 # NumberField # Demo PsyScope script # By Matthew, 10/22/92 # The purpose of this script is to use a lot of arcane scripting stuff # for example and texting purposes. It displays an array of numbers # such that no two adjacent (horizontally or vertically) are the # same. The number of row and columns is controlled by "Row" and # "Columns", and the digits displayed run from 1 to "MaxNumber". # THese three items are settable in the menus. Experiments:: NumberField Current: 1 NumberField:: AllStims(List) (NULL EventType: NULL Duration: Mouse[CLick] EventActions: [End[]] => [ClearScreen[]]) Format: Original EventType: Text InputDevices: Mouse Duration: 0 DataFile: "Func.psy Data" TrialCount: 2 Timer: Macintosh Optimize: False ClearType: No_Clear Rows:: 7 Cols:: 7 MaxNumber:: 5 # RemoveLast(list ago) returns a sublist containing all elements except # the one that was current "ago" accesses previous ("ago" > 0) RemoveLast:: `list `ago Result: Sublist(list PrevCurrentIndex(list ago) + 1 ListSize(list) - 1) # DelForCol(List col) returns a sublist containing all the elements except # the element that is to the left of this column DelForCol:: `list `col Result: if(col > 1 RemoveLast(list 1) list) # Stim(List row col) gets the stimulus for (row, col) using List. It is # assumed that Stim() is called over all row & columns, completing # each row from left to right and then all the rows from top to bottom Stim:: `list `row `col Result: Access(DelForCol(if(row > 1 RemoveLast(list @Cols) list) col)) y:> strcat(((100 * row)/(@Rows + 1)) "%") x:> strcat(((100 * col)/(@Cols + 1)) "%") # AllStims(List) returns the array of stimuli - with position set - drawing # the items from List AllStims:: `list Result: ([`row Result: [`col Result: Stim(list row col)]] ** (1 .. @Rows)) ** (1 .. @Cols) List:: 1 .. @MaxNumber SaveCurrents: @Cols AccessType: Random Menus:: AllStdLibMenuItems Field Field:: Rows Cols[ItemName: Columns] MaxNumber[ItemName: "Maximum Number"]