Darwinbots Forum
Welcome To Darwinbots => Newbie => Topic started by: MetalPaladin on March 08, 2010, 12:13:05 AM
-
I've been holding my breath for the emails to start going out again so I could validate my account, thanks for fixing that Nums.
Hi guys, new to the forum and Darwinbots, I've always wanted to use a program like this, just never thought to google "evolution simulator" lol. I'm still learning my way around the programs and around the DNA. In particular I was having a lot of trouble getting my veggies to grow. If anyone could help with that it'd be much appreciated. Shouldn't this work:
' Defining Variables
def cellage 150
.cellage 500 store
' Gene 2 - Growing
cond
*.robage *.cellage =
start
.strbody 10 store
.cellage 500 add
stop
Kind of sad to see so little developers working on the program though. I'd like to help, but only took a class of computer programming in softmore year of high school and don't remember much, we learned java and C++ anyway, not C#. If there's anything I can do though, let me know!
-
Welcome to the forums!
One reason reason why your veggie is not working is that the ".cellage 500 store" is actually never being executed. All commands must take place within a gene (def is the exception to this, but its not really a command). The other is that it you are mixing up the order of operations in the body of your code. What you would need is something like:
cond
*.robage 0 =
start
500 .cellage store
stop
cond
*.robage *.cellage =
start
10 .strbody store
500 *.cellage add .cellage store 'You also were never actually storing the new value to .cellage
stop
If you want to do an action on a certain interval a better way to do this is using the modulus (mod) operator. What the modulus operator does is return the remainder of a division, like you used to do in grade school. That lets us do this:
cond
*.robage 500 mod 0 =
start
10 .strbody store
stop
quite a bit simpler, and functionally equivalent
-
Thanks for not giving up
The current program you have in your hands is done in Visual Basic 6, actually. If you have a desire, some spare time, and a stubbornness not to give up at the first sign of problems, you might try fixing various bugs that have been reported. VB6 is very easy to learn, and the code, while a bit messy, is pretty easy to hack on. If you want to give it a go I can step you through the process.
Anyway, welcome.
-
Under the "General" tab, theres a slider called "Veg Body/NRG Distribution". If your bots are to small than you can increase this to make the veggies get more body automatically by the simulator.
-
Thanks guys! Shasta, that bit of code works great, thanks. And Numsgil I think I might be up for that, I'll give you a pm.
-
As an afterthought, C# is virtually identical to Java...