General > Off Topic

making my own DB fan-version

<< < (4/7) > >>

Numsgil:

--- Quote from: endercrypt on December 29, 2015, 12:57:23 PM ---
--- Quote from: Shadowgod2 on December 29, 2015, 12:08:33 AM ---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.

--- End quote ---

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?

--- End quote ---

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

The actual details you'll have to get from the source code for DNA execution.

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.

EnderCrypt:
wow, theres so incredibly much things i dont know, and the fact that my windows is basically broken and im stuck on mac (i hate mac's) really aint helping..

okay so, what i understood so far

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

* the cond operator is the only operator that resets the stack? does the start operator not do this?
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? also, hows does sin and cos operate?

also, thank you for the source, i had it very difficult trying to navigate the source links from the wiki :)

hmm, wow, i need to learn some VB some day

Numsgil:

--- Quote from: endercrypt on December 29, 2015, 01:44:26 PM ---things can only get stored on memory when the stack is empty/has true on top

--- End quote ---

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?

--- End quote ---

I think so.


--- Quote ---does the start operator not do this?

--- End quote ---

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?

--- End quote ---

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?

--- End quote ---

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.

EnderCrypt:
thank you for your reply, it helped alot :)

does your code, when given a strong of dna code, split each gene into its own object? im thinking of doing this

also, what did you mean by the fact that the START operator AND's the boolean stack ? could you further try explain? thank you :)

EnderCrypt:
why does .setaim accept a value between 0 to 1256, and also, is .setaim prioritized over things like .aimdx and .aimsx?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version