Code center > Suggestions

Bot Code Analysis Tool

(1/8) > >>

Prsn828:
First version:
http://www.mediafire.com/?i3pshzg3os73luk
This one isn't so much a suggestion as it is me stating what I'm going to try to do.
I figured this would be a good place to get commentary on the idea.

Here's what I have in mind:

Some sort of (probably java based) text editor that can take a gene and use an algorithm to parse bot code into infix notation using parenthesese.  I'd want to put other things in too, but for starters I think that alone would be helpful.

The other thought I had was to allow it to provide toggling between integers and their associated sysvars, so we could try to decipher evolved bots' codes more easily.

I haven't worked on any coding of bots recently, but I'm very confident I can get this working (and it'd help me to write some bots too).

I'm also thinking I might be able to have it work the other way, being able to take infix and translate it into postfix (while also preserving the infix version, or parsing it back for later editing).

Does this sound like something that would be helpful, or am I being overly ambitious here?

Ammeh:
That sounds amazingly useful. If you think you can do it, go for it :D

Prsn828:
I'm sure I can do it, but it will take me some time  :P
I'll work on it when I get home today.

Numsgil:
The hard part really would be parsing the code.  Not that it's hard conceptually just that it's a bit of a project, and everything else (conversion from postfix to infix) you can look up online somewhere.

You might also want to try something of an "optimizing compiler".  ie: given an evolved bots code you can prune out junk DNA which you know can't influence the bot's behavior.

Like if you had a bot that did:

0 0 10 sqrt 400 10 .repro store mul 0 0

You can do some static analysis and get that the "effective" DNA is only:
10 .repro store

Likewise if something does:

10 10 3 mul dup mul 9 div store

Since those are all constants you can collapse it down to:

10 300 store

which is the same as:

10 .repro store.

...

I want to add something like this to DB3 eventually (basically the end goal is a bot writing IDE that integrates into the program, let's you single step debug through bot code, watch windows, etc.), so if you make the code clean and readable we can probably steal some of it when the time comes.

Prsn828:
Actually, I was thinking of taking it even further, and letting it tell the user what genes, for instance, might rely on one another.

That comes later though, first is getting it running with basic conversions from postfix to infix and identifying where numbers are being used as sysvars, etc.

Navigation

[0] Message Index

[#] Next page

Go to full version