Author Topic: Arrays other topic  (Read 15005 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Arrays other topic
« on: February 21, 2005, 06:22:50 PM »
Dim memory(1000) as Intager 'this actualy already Exists in the program

Do '<--- this loop is the robot stack loop itself
memory(0) = 0
Do
memory(memory(0) + 100) = 999 - memory(0)*2 '<--- inpossible in the current virsion
If memory(0) > 100 Then Exit Do
Loop
Loop

***Can you later add the ability for the DNA to store values in arrays , not in memory one by one

***And Robots will be able to mutate all this stuff naturaly

***THE ABOVE CODE WHEN WRITTEN IN DB DOES NOT USE ANY NEW LOOPS , IT CAN USE THE Cycling of the program itself as a loop. That makes even more sense because now a robot takes more time to store a bigger erray

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Arrays other topic
« Reply #1 on: February 21, 2005, 07:19:41 PM »
ok I think what I am talking about is in the program already ex:

Quote
*.32 20 >
is a pointer from memory 32, is it greater then 20 ?

Therfore please include that it will mutate also; naturaly by the program: "Bots use there own memory to think , for once"

Am I correct some ? Am I wrong some ? , whats going on?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Arrays other topic
« Reply #2 on: February 21, 2005, 10:30:42 PM »
A quick note:

"*32", not "*.32"

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Arrays other topic
« Reply #3 on: February 22, 2005, 09:19:01 AM »
Quote
ok I think what I am talking about is in the program already ex:

Quote
*.32 20 >
is a pointer from memory 32, is it greater then 20 ?

Therfore please include that it will mutate also; naturaly by the program: "Bots use there own memory to think , for once"

Am I correct some ? Am I wrong some ? , whats going on?
Yes it will mutate naturally by the program.

 :D PY  :D
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Arrays other topic
« Reply #4 on: February 22, 2005, 12:47:48 PM »
OK MY FURTHER WORK/EXPERIMINTATION WITH ARRAYS/MATH :

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

PROBLEM :

WHEN I ADDED :
Quote
1
22
store
22
23
store '23 is the pointer to memory location 22

THIS STOPED WORKING :
Quote
20
inc

ANY ONE KNOW A SOLUTION?

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Arrays other topic
« Reply #5 on: February 23, 2005, 02:05:24 PM »
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

once thats possible , all erray monipulations are possible , but costly
« Last Edit: February 23, 2005, 02:25:24 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Arrays other topic
« Reply #6 on: February 23, 2005, 02:34:17 PM »
First, I'd recommend using some labels, cause *21 makes peoples' heads hurt.

Secondly I'll give it a look.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Arrays other topic
« Reply #7 on: February 23, 2005, 02:42:15 PM »
Here's a labeled up version of what bots posted:

Code: [Select]
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

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Arrays other topic
« Reply #8 on: February 23, 2005, 02:52:49 PM »
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

well can it?

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Arrays other topic
« Reply #9 on: February 23, 2005, 03:01:26 PM »
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
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Arrays other topic
« Reply #10 on: February 23, 2005, 03:25:56 PM »
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
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

was an error fixed by:
Quote
.a .apoint store 'apoint points to a
« Last Edit: February 23, 2005, 03:27:56 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Arrays other topic
« Reply #11 on: February 23, 2005, 03:27:21 PM »
Oh, yeah, sometimes comments aren't commented out, I'm not sure why.

I'll fix it, hold on.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Arrays other topic
« Reply #12 on: February 23, 2005, 03:29:43 PM »
Code: [Select]
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

This works right.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Arrays other topic
« Reply #13 on: February 23, 2005, 03:32:07 PM »
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

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

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

one more thing:

Quote
.a .apoint store store 'apoint points to a

I know it works but why do you write store twice , whats the use of that?
« Last Edit: February 23, 2005, 03:37:13 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Arrays other topic
« Reply #14 on: February 23, 2005, 03:39:21 PM »
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:
« Last Edit: February 23, 2005, 03:40:30 PM by Numsgil »