I'm having troubles at counting and displaying values from an array, this is what I'm doing:
Let's say this is the first row: (1 1 1 1 1 1 4 4 4 2 2 2 3 6 6 6 5 1 1 4)
I want to display how many <n>s are in a row. In this case it would be:
First we have 6 1s, so it should show: 6 1
Then we have 3 4s, so it should show: 3 4
After that, we have 3 2s, so it should show:3 2
Then it would be 1 3, 3 6, 1 5, 2 1 and 1 4
It doesn't matter where it displays this info, it could save it in another array with 2 columns, or display it in counters but I have no idea how to count it the way I want (the best I can do is to count how many of the same number are in the same row, but that's not what I'm looking for). Is there any tutorial/example to do this?
Thanks in advance, and I'm sorry for my broken english (my first language is spanish).