Moving numbers through an array

how to organize the movement of numbers in an array?

Please explain. You do not seem to be just moving numbers.

For example, to focus on one cell, why does 'myArray[0]' finally result in 1?

Action one doesn't change it. Action two seems to move a 3 there.

And, what does "press 6" mean?

data from cell [n] must be scattered over [n + 1], [n + 2], [n + 3] - if you do not go beyond the array, then there is no problem.
But what if you need to scatter numbers in cell [6]?

Please state the complete set of rules.

Define, "scatter". Edit - oh, I see you subtract the amount from a cell, and place units in the succeeding cells until the amount is exhausted.

Are you asking how to code it? You still haven't provided all the rules. For example, what if the cell contains a different number, like 4?

press [6] - means to select the 6th element of the array, the data from this element is scattered one by one over neighboring cells

Define "neighbouring".

Use the modulus operator to make the buffer circular. Or, just subtract the array size from the index if it exceeds the array size.

What prize do I get? :slight_smile:

1 Like

You have still not said what scattered means in this context

Typically, that is done by writing code. Please don't tell me you haven't written any...

I love your slides though.

You didn't feed back, whether or not you understood my solution...

If you write down all the rules, the code is easy to write.

But the rules come first, and they must be clear and unambiguous.

Use the modulus operator to make the buffer circular. Or, just subtract the array size from the index if it exceeds the array size.

What prize do I get? :slight_smile:

I'm already trying to do something :grinning:

Is this a school assignment?

Edit - your edit made this post look silly.

I'm already trying to do something

We're asking you to post that (the code you wrote).

Yes, yes, this is a task from the teacher.

Oh, then I'm probably out. I help people but I don't take courses for them. I appreciate your honesty, though...

Also you aren't very responsive to replies here. That will not encourage helpers.

If you wrote code, and you post it, and it has a few minor problems, then I can help. Otherwise I am doing more work even than the assignment itself because I have to struggle with your communications.

I will watch here to see if things improve.

Why not post the assignment, so that people can make sense out of what you are saying?

One possible reason might be, it would make it available to the professor's online search engine...

My suggestion was mostly facetious, but I am curious about the goal of the assignment (if there is one).