I'm trying to simplify my previous thread, because it was poorly exlained earlier, by me... :-)
first question:
i have a 10 column array, i want it to be sorted automaticly by appearance.
each new number is typed to the "0" column, and the prev numbers move one column to the left...
9-8-7-6-5-4-3-2-1-0 (top of the array, meaning the position of a number)
.............................
_________________6 (first number, goes on column 0)
_______________6_3 (next number is 3, in the"0"column, previous( "6" ) moves left)
_____________6_3_2 (2 is next, moving previous numbers left)
___________6_3_2_1 (1 is next, you get the idea)
the thing is, that the numbers can't repeat, ie when a new digit already appears in one of the prev rows numbers it appears only in the "0" column and not twice, still moving everything else left:
___________6_2_1_3 (3 is next, already there, so 6 stays put, and then everything moves to the left)
_________6_2_1_3_4 (4 is next, do not appear earlyer)
_________6_1_3_4_2 (2 appears, therefore 6 wont move because there isnt any new digits inserted, and everything except 2 moves left, as 2 stays in the 0 col)
second question:
ok, now I have to add another col to the left of these 0-9 cols, the cells in it have to tell me what was the position of the number I just put in the "0" col in each row. ie:
9-8-7-6-5-4-3-2-1-0 (my cols)
_________5-6-4-8-3 (just some row)
_________5-4-8-3-4_2(the new 4 appeared in col 2 in the prev row)
_________4-8-3-4-5_4(5, the new number, appeared in col 4 in the prev row)
how do i do that??
Bookmarks