Code center > Darwinbots3

Command Shortcutting

(1/8) > >>

spike43884:
Can we have for commands / operators in DB3 multiple names for them...Some people remember things differently you know :P

Numsgil:
This is already supported in DB3's DNA language (Sunweaver) using object macros.

For instance, you can do something like:


--- Code: ---def superadd mul

3 4 superadd

--- End code ---

And it'll push 12 on to the stack, same as if you called mul.

...

It can also "undefine" commands.  So you could do:


--- Code: ---def superadd

3 superadd

--- End code ---

And it'll leave 3 on the stack untouched, because superadd is not defined as anything (or more precisely, it's defined as an empty codule).

...

You can also redefine basic commands, because object macros have priority over everything else, including built in commands.  eg:


--- Code: ---def add mul

3 4 add

--- End code ---

Will push 12 to the stack, because we've redefined add to be mul.

spike43884:
I mean though, not manually reseting some but just built in alternatives. like .dx and .aimdx and .aimright do the same, because not everyone might remember dx but some people may still prefer dx. Just alternatives built in.

Numsgil:

--- Quote from: spike43884 on March 31, 2015, 12:16:03 PM ---I mean though, not manually reseting some but just built in alternatives. like .dx and .aimdx and .aimright do the same, because not everyone might remember dx but some people may still prefer dx. Just alternatives built in.

--- End quote ---

Why is that better than just building your own?

spike43884:

--- Quote from: Numsgil on March 31, 2015, 02:00:21 PM ---
--- Quote from: spike43884 on March 31, 2015, 12:16:03 PM ---I mean though, not manually reseting some but just built in alternatives. like .dx and .aimdx and .aimright do the same, because not everyone might remember dx but some people may still prefer dx. Just alternatives built in.

--- End quote ---

Why is that better than just building your own?

--- End quote ---
Because you can't build your own if you don't know what it originally does.
Plus, manual changes take time. Time wasting everyone hates.


OFFTOPIC: Considering you work for google, and google (and pretty much any company in the spotlight) has to like education, why not have a darwinbots schools league? It fits in to STEM, it'd be brilliant a DB schools league, various students from the school create a bot for their team, then its put into a nice big league. Of course then google might even give you a big computer to run the leagues on :D An with the central terminal with video outputs, we can stream the simulation straight to the students, they can have all the info at their hands, and watch it unfold. Then some quick simple programming to automate the leagues more and Boom! And before you go "No, no no, its not that good" DB is the best opensource life simulation thats there for free, and nobody else has done a life simulations schools league thats remotely notable.

Navigation

[0] Message Index

[#] Next page

Go to full version