variables: inputfocusitemindex = index of current item (can be min 0 max…
- User
variables: input_focus_item_index = index of current item (can be min 0 max input_focus_count) shift = how many steps to take from current index input_focus_count = total items count (non-zero based), input_focus_count - 1 is the maximum index possible
Function A. go next for 'shift' steps taking into account the minimum of 0 and maximum index formula: (input_focus_item_index + abs(shift) + input_focus_count) % input_focus_count
If current index is 15 and function is called with shift 10 then current index will equal 5. (e.g. 10 steps forward were taken from initial index 15, first 5 steps to reach maximum of 20, then 5 more after 0 resulting in new index 5 - wrapping). MORE EXAMPLES: input_focus_item_index = 0 shift = 1 input_focus_count = 5 -> input_focus_item_index = 1
input_focus_item_index = 3 shift = 2 input_focus_count = 5 -> input_focus_item_index = 0
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.