I have data in array scattered but I want them something like this.
How can I get this
https://drive.google.com/file/d/1MyRjVEblH_o1HQL_MpUmPO71Gr8GV3hm/view?usp=sharing
can you explain it How its working?
btw y axis also need to sort, On y1 there is no data So shift data of y2 to y1
Develop games in your browser. Powerful, performant & highly capable.
https://drive.google.com/file/d/14aKWbiofQWv6t2ldPu5-Alc2cGt1B3SY/view?usp=sharing
Well. English is not my main language. But i'll try to explain. I performed a two step process. First step (the one i posted earlier) is just using built-in sort function. This function only works one dimensional. So you need a loop for every row (or column if you prefer). Sort function only work from small to large. So an extra reverse is needed. Second step is shifting. With a help of a loop, first i found empty rows (i named it starting row). And with another loop i found filled rows (i named it target row). I copied target row to starting row. And then i give 0 to target row