Here is a little program that will insert "0s" into a list. So if I send it
Code:
it will return
Code:
This is the little program
Code:
If I give it consecutive numbers like
Code:
it throws an invalid dim error. Is there a way to modify the code so that it will accommodate both the "0s" and consecutive numbers? Like
Code:
Just a bit of clarification. When in the original code the "0s" were used to skip a problem. In the new code when the two numbers in the list are consecutive we want these two problems to be displayed.
In the example above we want problems 1 & 2 which are consecutive to be displayed. Since there is no number 3 in the list we want problem 3 to be skipped & problem 4 displayed. Finally we want problems 5,6,7 to be consecutively displayed
Code:
{1,3,5,7,9}→⌊OVER1
it will return
Code:
{1,0,3,0,5,0,7,0,9}→⌊OVER1
This is the little program
Code:
0→R
seq(0,J,1,16→⌊TEMP5
For(R,1,dim(⌊OVER1
⌊OVER1(R→⌊TEMP5(⌊OVER1(R
End
⌊TEMP5→⌊OVER1
If I give it consecutive numbers like
Code:
{1,2,3}→⌊OVER1
it throws an invalid dim error. Is there a way to modify the code so that it will accommodate both the "0s" and consecutive numbers? Like
Code:
{1,2,4,5,6,7}→⌊OVER1
Just a bit of clarification. When in the original code the "0s" were used to skip a problem. In the new code when the two numbers in the list are consecutive we want these two problems to be displayed.
In the example above we want problems 1 & 2 which are consecutive to be displayed. Since there is no number 3 in the list we want problem 3 to be skipped & problem 4 displayed. Finally we want problems 5,6,7 to be consecutively displayed