Code center > Suggestions

Arrays other topic

<< < (3/8) > >>

Botsareus:
Num what you gave me in the dna viewer looks like:

--- Quote ---cond
  *20
  0
  =
start
  20
  21
  0 'notice all the extra zeros , thats another bug...
  0
  0
  0
  1
  22
  store
  22
  23
  store
  0
  0
  0
  0
stop
-------------- 2
cond
start
  20
  inc
stop
-------------- 3
cond
  *20
  100
  >
start
  0
  *21
  store
stop
-------------- 4
end
--- End quote ---
and it does not reset after 100 back to 0
and without the "def" stuff it works completly different too ; try it without the def ,the way I wrote it, because: if this code ever will accure naturaly , thats the way it will accure: without the "def"s

P.S.


--- Quote ---.a .apoint store store 'apoint points to a
--- End quote ---

was an error fixed by:

--- Quote ---.a .apoint store 'apoint points to a
--- End quote ---

Numsgil:
Oh, yeah, sometimes comments aren't commented out, I'm not sure why.

I'll fix it, hold on.

Numsgil:

--- Code: ---def a 20
def apoint 21
def c 22
def cpoint 23

cond
*.a 0 =
start
.a .apoint store store
'apoint points to a
1 .c store
.c .cpoint store
'cpoint points to c
stop

cond
start
.a inc
stop

cond
*.a 100 >
start
0 *.apoint store
stop
end
--- End code ---

This works right.

Botsareus:

--- Quote ---and without the "def" stuff it works completly different too ; try it without the def ,the way I wrote it, because: if this code ever will accure naturaly , thats the way it will accure: without the "def"s
--- End quote ---


--- Quote ---The problem is that robots will mutate the "unlabled-up" virson , so check that one as well , thanks in advance
--- End quote ---

Here it is again , stay with me here , :


--- Quote ---cond
*20
0
=
start
20
21
store '21 is the pointer to memory location 20
1
22
store
22
23
store '23 is the pointer to memory location 22
stop

cond
start
20
inc
stop

cond
*20
100
>
start
0
*21
store
stop

end
--- End quote ---

one more thing:


--- Quote ---.a .apoint store store 'apoint points to a
--- End quote ---

I know it works but why do you write store twice , whats the use of that?

Numsgil:
If you're having trouble with that bot code, Bots, its 'cause the comments aren't commenting out.

Has anyone ever had success with in-line comments?  It might be that they never worked, and we (atleast Bots and I) keep thinking they do.

The two stores you noticed is my brain collapsing.  Pay no mind to the man behind the curtain.   :rolleyes:

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version