OK the first thing you said that twolinesformed=8 is an actual location it is an offset and not a value. My question why would i need to know the location of twolinesformed if I am going to be using the Array(X,Y) with the stype boardsteps. Do I still need to know each variable, x1,y1,x2,y2 and twolinesformed their offset location before placing values in them? How then the concept of array works if I am manually having to locate their value in memory?
The second part where I asked you about boardheader=4 you said that is to store the dminseions of the array...but from the looks of it I am using single array with size 4...so this I need to ignore then completely and just simply focus on the two dimension array with size more than 4. Am I correct so far?
But...maybe I am wrong completely maybe i still need boardheader because you are using it to store the value of board. But why 4? Is 4 enough for what I am using? What if I went larger would they ruin the whole thing?
In this code down below:
rem now to allocate the board
board=boardheader+(32*21*boardsteps)
Reserve As Work 15,board
poke start(15)+boardx,32
poke start(15)+boardy,21
You said Start(15)+boardheader marks the start of the actual array...why you choose 15? Why not 0 or 12 or 3 or 6? Does that mean all my arrays they must start at 15?
Now here is the thing that I am little confused...you said boardx and boardy...am I taking it that these size will change based on the mouse location or the cursor location in the board or how exactly are these values changed?
Can boardx=210, boardy=34? Does that mean if the plotted dot on the board is plotted on 210, 34 that these values will actually be stored in boardx and boardy and the size of the array is array(32,21) is that how it work? But what about X2 and Y2...where does that go?
You said poke start(15)+boardx, 32 and poke start(15)+boardy,21 is the storing of the dimensions of the array in the header...you confirmed that with a yes. That is good so far....
So how does this work
for y=0 to 21
for x=0 to 32
if boardarray(x,y)=0
board(x,y)\x1=x1:board(x,y)\y1=y1:board(x,y)\x2=x2:board(x,y)\y2=y2
' do the necessary flags to quit the entire loop all together
end if
next x
next y
With what you did up in terms of poke start(15)+boardx, 32 and poke start(15)+boardy, 21, I do not see the x1,y1,x2,y2 in the equation and most importantly I do not see or know what is suppose to increment boardx, and boardy with and by how much and why?
You said this "If you use arrays in your code, the compiler or interpreter generates all of this for you. If you do banks of memory in Amos you have to do in manually. Sometimes this is desirable since you can use integers that are smaller than 4 bytes each, as I have done in these examples. On an Amiga 500 (or any 16-bit Amiga) the smaller 2-byte integers access at twice the speed of 4-byte integers in addition to taking less memory."
What if I do not want to have the "Advanced" version of array...and maybe to some..they need full control of everything and perhaps they can use it to optimize their code and execution to be a junior level like me and who is new in AMOS will find this a bit of an advanced topic. He wants to learn the scope of programming in AMOS and what to feel happy he have released his first Amiga game so he can move on to the next project...now maybe I should learn this in the future because maybe my future projects demand that I go through this approach...now essentially my question to you is...do I have to do it this way as you said below:
def fn boardarray(x,y,offset,banknum) boardheader+offset+((x+y*(peek(start(banknum)+boardx))*boardsteps)
and ther eis no other option behind it? If what you are saying is true...then teach me the above how it works all together, the x,y, offset, banknum with boardheader+offset+x+y, etc...pretend I am a student coming to first year class university. I have no idea what so ever in the above code how it works and function and why you did it this way and why you inclided banknum and why you also included boardsteps and how are these values boardheader, offset, x,y, boardx and boardsteps changes value in during game and why they needed to be changed?
Here is my question if I want to take this code here
for y=0 to 21
for x=0 to 32
if boardarray(x,y)=0
board(x,y)\x1=x1:board(x,y)\y1=y1:board(x,y)\x2=x2:board(x,y)\y2=y2
' do the necessary flags to quit the entire loop all together
end if
next x
next y
using the boardstep how do I go about doing that with bank? Forgive me if I sound a little frustrated, it just I am not understanding how this works...and no course in university is going to teach me this and I have no intention of going through the beuracracy of taking a course in college and spending 1000 dollars for four month to teach me this and they are not going to teach me this...they are going to teach me .net and visual studio and html5...so..and no book here in AMOS is going to teach me either...I need someone here in the community to explain this to me...I promise ones you explain it to me (slowly) and I get it...it will stick in my brain and I can zoom clearing without any problem...I just need to understand what you are trying to say with your code.