I am confusing when do we subtract or add one to the position?
I'm not sure exactly what you are asking but, I think the answer is randomly. You have to generate -1 or 1 randomly each time and then add that to the position.
I understand the routine assignment is already due, but what may help for future reference is you can do a conditional statement where if your random number is 0 the position is "position++" and your else would be "position--"