Code center > Suggestions

Arrays other topic

<< < (2/8) > >>

Botsareus:
I should of posted this in the bugs board , can any one help? , this is a real bug!


also will be nice if robots mutate stuff like :


--- Quote ---*21
store
--- End quote ---

once thats possible , all erray monipulations are possible , but costly

Numsgil:
First, I'd recommend using some labels, cause *21 makes peoples' heads hurt.

Secondly I'll give it a look.

Numsgil:
Here's a labeled up version of what bots posted:


--- 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 ---

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

Someone please ans:

--- Quote ---*21 'can a pointer followed by a store mutate?
store
--- End quote ---

well can it?

PurpleYouko:
Anything can mutate

The DNA is stored in two parts. The first thing that the program does is to de-tokenize the sysvars and make them into numbers.

The first part of the DNA array is "tipo" (Italian for type)
The second part is "value" (Italian for value  :rolleyes: )

I can't be bothered to check the exact coding for this right now but it goes something like this.

*20 becomes DNA(n).tipo=1 and DNA(n).value=20

The type 1 indicates that this is a pointer to a memory address.

If you leave off the * then tipo wil be 0

if it was *. then the interpretter looks for an alpha-numeric sysvar and tipo becomes 2

When the robot mutates tipo and value are randomized for the particular line of DNA code so that any outcome is possible.

if tipo is 0 then the number after it is just a number.
if tipo is 1 then the number after it represents a pointer to a memory address
if tipo is 2 then the number after it is treated as a sysvar (if one exists for that number)

And so on

 :D  PY  :D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version