Author Topic: Bot Code Analysis Tool  (Read 14982 times)

Offline Ammeh

  • Queen of the Internets
  • Bot Destroyer
  • ***
  • Posts: 169
    • View Profile
Re: Bot Code Analysis Tool
« Reply #30 on: September 11, 2010, 06:26:59 PM »
*reaffirmed beliefs that python is evil*

>.>

If you wanna post the code after you're done doing all the hard bits :P I can rewrite it in Delphi or something. exe will be a fraction of the size.

Offline Shasta

  • Administrator
  • Bot Destroyer
  • *****
  • Posts: 231
    • View Profile
Re: Bot Code Analysis Tool
« Reply #31 on: September 11, 2010, 07:51:35 PM »
12MB really isn't that bad, unless you are on dialup. I wouldn't worry about it.

Offline Billy

  • Bot Destroyer
  • ***
  • Posts: 175
    • View Profile
Re: Bot Code Analysis Tool
« Reply #32 on: September 11, 2010, 07:56:23 PM »
I can download it in less than a minute.

Okay, I can use it now. This should be quite useful. Can't wait for postfix/infix toggling.
"I cannot persuade myself that a beneficent and omnipotent God would have designedly created parasitic wasps with the express intention of their feeding within the living bodies of Caterpillars."

-Charles Darwin

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
Re: Bot Code Analysis Tool
« Reply #33 on: September 13, 2010, 08:00:33 AM »
Postfix/Infix should be the next addition, following when I figure out how I want to format the file so that it can be saved with or without (depending on user selection) infix code remaining in the save file.

It'll probably end up having some HTML style tags in the code when infix is saved into a file, so that it can remove the tags and translate back when it is saved for use by Darwinbots.
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!

Offline Prsn828

  • Bot Destroyer
  • ***
  • Posts: 139
    • View Profile
Re: Bot Code Analysis Tool
« Reply #34 on: September 17, 2010, 08:19:07 AM »
I've been doing a little work on thinking about the interpreter.

Depending on how I decide to do it, it may come before postfix/infix translations.

Speaking of postfix/infix, I need some opinions on this.
Should I go all-out parenthasizing to the point where it looks like Lisp turned into Darwinbots infix, or should I use order of operations? (PEMDAS) (Parentheses-Exponent-Multiplication-Division-Addition-Subtraction for those who might be drawing a blank here).

I really need a good idea of what people want (unless you want it to be an option).

It might even be worth thinking about using grammars or something similar to automate the translations, and to make them customizable.

By the way, I do have a way in mind to avoid the problems of unknowns when writing the interpreter.
It's kind of like an algebra system, where unknowns are left in the system as values, allowing the evaluation to progress to any number of steps.


For instance, when evaluating:
Code: [Select]
*.eye5 2 addWe get the result:
Code: [Select]
(*.eye5 + 2)Which would then be on the stack, and is treated as if it were just another integer value.

The hardest part will be dealing with code branching, but at first I can simply use the trinary a?b:c operator whenever one of those comes up (it'll be pretty ugly though).

One issue with this is that *.eye5 could (and often should) have different values for different time-steps.
The solution is to make an object to replace the string *.eye5, and have that object track which step it is from.

Then, after the code has been interpreted this way for some number of steps, the user could input the unknowns to debug their robot.

While tedious, I do believe this will be a very powerful and helpful tool when completed.

Give me some feedback so I can get a better idea of what I am aiming for here.
So, what will it be? Will you submit to my will, or must I bend reality to suit my needs?
Better answer before I do BOTH!

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Bot Code Analysis Tool
« Reply #35 on: February 09, 2011, 11:15:00 AM »
How about this:

One text box with the original code.
One with the 'simplified' code that is still in db.

When you select a portion of the simplified code it displays a 3rd text box with the 'real order of operations' for that selection.

If you modify the third textbox it changes the selected code in the second textbox.

P.S.

Prsn , keep us updated...
« Last Edit: February 09, 2011, 11:28:06 AM by Botsareus »