Author Topic: Basic Math  (Read 7835 times)

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Basic Math
« on: February 21, 2005, 04:01:05 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(0) = memory(0) + 1
Debug.Print memory(0) 'there should be some kind of Debug in Db right
If memory(0) > 100 Then Exit Do
Loop
Loop

***The above is inpossible to program in DB for me , CAN ANYONE GIVE ME A WORKING DNA FOR THAT WITH A INFORMATION ON HOW TO DEBUG AS WELL?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Basic Math
« Reply #1 on: February 21, 2005, 06:08:28 PM »
There aren't any loops in the DNA.  If we added them, infinite loops could potentially develop.  Straightforward DNA execution helps add to program stability.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Basic Math
« Reply #2 on: February 21, 2005, 06:15:06 PM »
I know there is no loops, I am talking about each sycle increases the number by 1. So it takes 100 sycles to increase the number to 100
« Last Edit: February 21, 2005, 06:25:01 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Basic Math
« Reply #3 on: February 21, 2005, 06:51:28 PM »
I'm not sure what it is you want then.

Unless you just want to have:

cond
*.var 100 <
start
.var inc
stop

And to debug, load up the console for a robot.  It has all kinds of useful debugging tools.  Type help to get a list of them.
« Last Edit: February 21, 2005, 06:53:44 PM by Numsgil »

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Basic Math
« Reply #4 on: February 21, 2005, 06:56:44 PM »
There we go , lest time I tryed that it did not work , the robot console was returning 0 , also how do I later reset the number back to 0 when its over 100 so it repeats the whole thing again

by "*.var" what do you mean? There is only memory locations from 1 to 1000

if *.var did mean a memory location , I have never seen
Quote
*.var 100 <
mutate naturaly in the program

forget about
Quote
*.var *.var  <

I am hopeing that num ment somthing like:

Quote
cond
*.32 100 <
start
*32 inc
stop
« Last Edit: February 21, 2005, 07:03:02 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Basic Math
« Reply #5 on: February 21, 2005, 07:03:13 PM »
To reset it, have this before the below gene:

cond
*.var 100 >=
start
0 .var store
stop

Also, by *.var I mean a custom label.  At the top of your DNA have this:

def var memorylocation. where var is the label name and memorylocation is a free memory location.

inc tends to work differently than a store command.  Inc seems to work more immediatly, so make sure you don't do something like:

cond
*.var = 0
start
.var inc
stop

cond
*.var = 1
start
.var inc
stop

or it will execute both genes.  Place them in reverse order and you're safe.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Basic Math
« Reply #6 on: February 21, 2005, 07:04:47 PM »
And *32 inc won't work like you want.  It needs to be 32 inc to increment memory location 32.  Unless you're using 32 as a pointer.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Basic Math
« Reply #7 on: February 21, 2005, 07:06:55 PM »
Num can bots mutate there own custom labels , or atleast reguler memory locations and memory pointers !!! yey !!!! , or else I start a new thread

ex:

*.32 100 <

or is it

.32 100 <

now I am confused

if
Quote
*.32 100 <
really means a pointer from memory location 32, then I should have never started "errays other topic" thread, But now there is use for the "errays other topic" thread once more!!!!

 :D sorry for the complete inconsistency
« Last Edit: February 23, 2005, 02:22:35 PM by Botsareus »

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Basic Math
« Reply #8 on: February 21, 2005, 07:13:46 PM »
Bots can (I think) mutate to use new memory locations.  I'm not sure how advanced the code is for it, to be honest.  One of these days I'll go through the mutations code and rework it a bit.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Basic Math
« Reply #9 on: February 21, 2005, 07:15:39 PM »
Make sure mutation works for "condition" part of the gene , I know mutation really works well creating memory locations in the "execution" part of the gene

make sure its for bouth pointers and reguler memory...

...This conversation has moved to the (suggestions > "arrays other topic") thread

thanks for your help Num
« Last Edit: February 21, 2005, 07:23:45 PM by Botsareus »

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
Basic Math
« Reply #10 on: February 22, 2005, 09:15:52 AM »
Quote
can bots mutate there own custom labels , or just reguler D$$#amed memory locations

No. Bots cannot mutate their own custom labels.

The def command is not stored as part of the DNA code within the program. The bot only sees the memory location value and not the label.

It would be quite possible for a robot to evolve the use of a memory location as a custom variable but it would not have a name.

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

:D PY :D