yes store commands can and often times do evolve in the cond start section like the sim i am currently running, and yes the values on the stack do nothing. either they disappear or are untouched idk. however values can gene hop and be executable in later genes(an unused value in gene 1 can be executable in gene 5 for example) this could ably to the cond start values being executable in the start stop section too.

values can genehop?? wait, the stack persists through multiple genes? is there a COND ... START stack persisting through all genes COND ... START and so on?

The cond ... start ... stop architecture is a legacy artifact of how the DNA used to work. Any more, there's an integer stack, a boolean (conditions) stack, and operators that do things to those stacks. I think start ANDs together all the values on the boolean stack. That's it, really. The inc, dec, and store commands will only actually store values if the top value on the boolean stack is true. I think cond basically clears out the stacks. Which makes drawing neat lines between genes more difficult. But then, that's kind of true of real life too

There's also a C# sort-of version (it's got a lot of changes that aren't compatible, and features the old DNA doesn't have like limited looping ability and function calls) of the DNA that I'm using for a newer version I'm working on. It's not Java, but it might give you some ideas, and Java and C# are very close to each other syntactically. You might want to start looking through the source code here to get an idea about the commands.

things can only get stored on memory when the stack is empty/has true on top

An empty boolean stack is treated like 'true'. An empty integer stack is treated like '0'. So yes, things will only get stored to memory when the boolean stack is either empty or has true on top.

Quote

the cond operator is the only operator that resets the stack?

I think so.

Quote

does the start operator not do this?

No. The start operator ANDs together all the values on the boolean stack. But it doesn't touch the integer stack, I don't think. It's been a while so I might not be the best resource on this anymore.

The stop operator basically skips executing anything until the next cond statement is found. This basically lets you put "junk DNA" between genes if you feel so inclined.

Note that you can still use the cond...start...stop format. It will just sort of magically work like you would expect. But the underlying DNA language is actually quite a bit more flexible.

Quote

wait.. is the integer stack.. an integer stack, like.. cant you put decimal'ed values into stack, i know the memory doesent allow decimals, but.. the stack?

Commands know which stacks to operate on so they don't get confused. Basically if you expect something to return true/false it will get put on the boolean stack. If you expect something to return a number, it goes on the integer stack.

Quote

also, hows does sin and cos operate?

The wiki entry on cos is up to date actually. The input is in radians * 200 (so basically between 0 and 628), and the output is the normal value between -1 and 1, but multiplied by 32000.

In order to get this behavior, when a start is encountered, if there's more than one value on the boolean stack they're all combined together with an AND.

Quote

why does .setaim accept a value between 0 to 1256

A complete circle is 2 pi radians. Multiply that by 400 and you get 1256, which is sort of close to 1000 (which is a nice round number) and can be evenly divided in to 8 slices. So a full circle is 1256 units, and the number was chosen kind of arbitrarily. There are better numbers to choose (1080 is also close to 1000, maps to degrees, and has better prime factors (2, 2, 2, 3, 3, 3, 5) ), but for legacy reasons we're stuck with it.

You might double check my answer about sine/cosine. I'd expect them to use the same same scale, so I might have gotten it wrong.

In order to get this behavior, when a start is encountered, if there's more than one value on the boolean stack they're all combined together with an AND.

ah, so basically.. the gene executes aslong as there are no false in the boolean stack (correct me if im wrong)

Quote from: Numsgil

A complete circle is 2 pi radians. Multiply that by 400 and you get 1256, which is sort of close to 1000 (which is a nice round number) and can be evenly divided in to 8 slices. So a full circle is 1256 units, and the number was chosen kind of arbitrarily. There are better numbers to choose (1080 is also close to 1000, maps to degrees, and has better prime factors (2, 2, 2, 3, 3, 3, 5) ), but for legacy reasons we're stuck with it.

wow, you been thinking about this alot!

hmm, im gonna try go for the 1080, also, could you explain the prime factor thing? i dont really understand the point of it, except that multiplying them gets you 1080, also, what stops us from multiplying pi with (1000/pi) which would make a circle be 0 to 1000?

also, speaking of what i said:

Quote from: endercrypt

and also, is .setaim prioritized over things

does the sysvar list on darwinbots have some sort of .. priority of execution? because at the moment i got a randomly ordered list of all sysvars, and during each cycle all the sysvars get re-init (dont know what to call it, but i think you get what i mean, for example .robage, always get set to the robots age, before gene execution ) and after that it executes some code, for all sysvars, again randomly because the randomly ordered list

also, just realised a thing while writting the quote.. did i mess up by not making my e (first letter) in endercrypt, capital, i see you got your first letter as capital... but i dont.. great

Quote from: Numsgil

Try it and see

that is so tempting! but yeah, sadly.. im stuck on mac, and i dont think that will change.. for a long time.. so yeah, the only option i got to re-live darwinbots is playing at some other computer or.. make my own version, and making my own version is kinda fun + with your/administrators permissions, i'd love to open source my code at github (as approaches completion), problably wont get even close to as awesome as the real version of darwinbots which, for me has always stood as.. the holy grail for me, in a programming perspective i mean, darwinbots is the program that made me intrested in evolution and artificial intelligence ^^

edit:

http://wiki.darwinbots.com/w/Anglecmpit says "Calculates the shortest angle between the two angles given. Angles in DarwinBots are expressed in radians multiplied by 200."so... didnt we previously say that radians in DB was multiplied by 400?

also could you give an example of how to use this operator, as i never used it myself

In order to get this behavior, when a start is encountered, if there's more than one value on the boolean stack they're all combined together with an AND.

ah, so basically.. the gene executes aslong as there are no false in the boolean stack (correct me if im wrong)

Yeah, basically.

Quote

hmm, im gonna try go for the 1080, also, could you explain the prime factor thing? i dont really understand the point of it, except that multiplying them gets you 1080, also, what stops us from multiplying pi with (1000/pi) which would make a circle be 0 to 1000?

The more prime factors you have, the more ways you can evenly divide the number in to equal parts. For instance, say a full circle is 1000 units. Say you want to turn 120 degrees (basically a third of a circle). You'd have 333.33333333 units, which you'll have to truncate to 333, since it's all integers. It'll be very difficult to have exactly three equal rotations then. That may or may not be a problem, of course, depending on your goals. I'd say you either want lots and lots of prime factors, or none and have it be a prime number. The prime number would necessarily add some "fuzz" to integer angular calculations, which could be desirable.

Quote

does the sysvar list on darwinbots have some sort of .. priority of execution?

Not really. There's the order things are run in, but I'm not sure that has any particle rhyme or reason to it.

Quote

also, just realised a thing while writting the quote.. did i mess up by not making my e (first letter) in endercrypt, capital, i see you got your first letter as capital... but i dont.. great

There's also virtual machine installs if you want to play around with that. Depends how tech savvy you feel.

i think i already got wine under mac here, lets see..ah, here we go: the moment i press "start new" simulation i get:

and then it crashes, and i get this message:

(after closing it, darwinbots re-appers, but no buttons work, and i had to just close it)

now, according to the wine forum, your not suppose to give admin to files under wine because of security risks or something, im not sure, but yeah, im not so good with macs, but i definetly think i'd be able to get a virtual machine up with some googling.. hmm.. dont have a windows cd though...

It looks like a program crash. That is, something independent of the fact that it's running under Wine. Admin here I think means Darwinbots admin, ie: the guy currently fixing things. You can look at the files it wants to send, there's nothing in there really interesting from a security perspective. It's just a save of the Darwinbots sim and some of the settings.

If you create a new thread in the bugs and fixes forum with the attached settings that's a good way to have someone maybe look at it.

The cond ... start ... stop architecture is a legacy artifact of how the DNA used to work.

Well, it is still kinda used for stuff like virus and gene deletion. So for pure ALife like Darwinbots it will be wise to keep such things.

Quote from: EnderCrypt

http://wiki.darwinbots.com/w/Anglecmpit says "Calculates the shortest angle between the two angles given. Angles in DarwinBots are expressed in radians multiplied by 200."so... didnt we previously say that radians in DB was multiplied by 400?

also could you give an example of how to use this operator, as i never used it myself

So if you google "how much is one radian" and you put in Pi for radian you get 180 degrees.So two radians is the full circle or 360 degrees or 6.28~. If you multiply 6.28 by 200 you will get 1256 which is what db uses.

Now the difference between to angles is more interesting then taking the absolute value of subtracting one angle from another because like on a clock if you take 12:00 and subtract that from 1:00 you will not get 11:00 back but you will get 1:00.