Author Topic: History of 'Else'  (Read 2427 times)

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
History of 'Else'
« on: June 23, 2006, 06:40:23 PM »
Can someone enlighten me as to to the history of the else condition in the DNA flow control?  I'm investigating issues with gene counting and bots mutating an else flow control is one reason gene numbers can get strange when comparing the txt file v. the DNA as parsed and numberred in the bot properties dialog v. the gene activations count in the console...

Is the else clause a finished and sactioned feature of DB?
Does anyone use this?
If a gene has a else clause, how do people want the gene activation display to work?  Always fire?  Create a second fantom gene for the else?
Are the exact DNA sytax rules for else written down somewhere?  I assume the else clause fires when the cond statements are not met.
Must a gene have a start section?  What if if it has only an else section?
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
History of 'Else'
« Reply #1 on: June 23, 2006, 10:07:40 PM »
Else is relatively new, added in 2.4, by me.  Since it's so new, it hasn't been used a whole lot.  (Very few bots have been designed for 2.4).

Else and Start should be what's considered "genes", with the cond part a sort of out-of-stream controller.  Or that's how I envisioned it anyway.  The whole thing gets rather complicated in this regard.

For instance, you could have a cond with no associated gene, or several genes controlled by a single cond.

You are right that else should fire when cond is not met, the exact opposite of start.

Most regular commands need to be in either a cond, start, or else block to fire.  Some need to be in a start or else block to fire.

I spent alot of time deciding on how the DNA stream should be interpreted, but far less time deciding the macroscopic architecture.  Viruses, which take a "gene" and pass it on somewhere else complicate things (Conventional viruses should work in 2.4, but some mutated genomes might behave peculiarly) as does the GUI, and delgene, and such other "non-essential" elements.

If you gain any insights into a better way, that would be wonderful.  I was mostly planing on changing the way everything that relied on "genes" worked.  Viruses using codules instead, etc.
« Last Edit: June 23, 2006, 10:08:12 PM by Numsgil »