Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gobo

Pages: 1 2 [3] 4 5
31
DNA Tools / Sanger
« on: November 30, 2007, 06:40:24 PM »
You cannot operate stacks directly with Sanger 2.0 (at least, at the moment). You must store a value into the memory. Otherwise there would be much confusion, because the integer stack is used for expressions evaluation.

Though 'if (false)' shall work right (it doesn't, because I forgot to define true and false   )

32
DNA Tools / Sanger
« on: November 30, 2007, 06:26:18 PM »
Yes, surely it's collapsable. You can do arbitrary deep nested ifs. I just wanted to save the whole logic of Animal Minimalis to have a better analogy.
Code: [Select]
friendly() -> *.refeye == *.myeye;

always {
    /* Food Finder + Eat Food + Avoiding Family */
    if ( *.eye5 > 0 && !friendly() ) {
        .dx = *.refveldx;
        if ( *.eye5 > 50 ) {
            .shoot = -1;
            .up = *.refvelup;
        }
        else {
            .up = *.refvelup + 30;
        }
    }
    else .aimdx = rnd(314);
    
    /* Reproduce */
    if ( *.nrg > 20000 ) .repro = 10;
}
Formatting is in the queue. It's not of the first priority, I hope you agree.

Perhaps I will remove cond from definition of always gene. But stop is better to stay, imho, because there may be more than one gene, and it's not a great deal to save a single command in the special case of the last gene.

33
DNA Tools / Sanger
« on: November 30, 2007, 05:58:16 PM »
Sanger 2.0 (alpha) is released!
http://www.ersatz.org/sanger-2.0.zip - source
http://www.ersatz.org/sanger.html - online

34
Suggestions / Gene structure - cond start stop
« on: November 30, 2007, 05:12:24 PM »
Quote from: Numsgil
Thus you have bob (like bobbing hair), swab, and dub.
Though I'd prefer drob over bob anyway

35
Suggestions / Gene structure - cond start stop
« on: November 30, 2007, 11:06:11 AM »
Quote from: EricL
I like 'bool' better than 'b' and I like 'pop' better than 'drop'.  Pop is the well understood term for popping a value off a stack and bool is more descriptive.
pop is well understood term for popping a value off a stack and store it in a variable or a register. It's drop that is used for discarding the top value in languages operating with stack, such as Forth. And 'bool' is too long itself to join it with something else, IMHO. I don't insist, I just try to explain my position.

36
Single store / Nano (SS)(MacadamiaNuts)-02.02.07
« on: November 30, 2007, 10:37:31 AM »
Sorry, I just don't understand, how it might work
As I understood the code, it just stores 50 at random locations, which are

 -4     ?
  1     .up
 26     ?
 31     ?
295     ?
300     .repro
325     ?
330     .tie
496     ?
501     .eye1
526     .eye6dir
531     .eye1width
795     ?
800     .out1
825     ?
830     ?

Only useful of those are 1, 300 and 330. How does it tiefeed? Where is .eye5 adjust here?

37
Suggestions / Gene structure - cond start stop
« on: November 30, 2007, 05:06:43 AM »
I'd also shorten 'bool' to just 'b' and put it in the beginning and changed 'pop' to 'drop' (which is more descriptive)
Code: [Select]
drop
bdrop
clear
bclear

38
Bugs and fixes / Is it an intra-DNA conditions bug RESOLVED (BY DESIGN)
« on: November 28, 2007, 07:24:06 PM »
Oops, sorry  

39
Suggestions / Gene structure - cond start stop
« on: November 28, 2007, 07:20:16 PM »
It would be also nice to have a command that drops the top value from the boolean stack. It is an extremely important functionality, since it has sense of ENDIF. As for now, I couldn't express it with less than three commands: true or and. I think it's highly expensive (moreover difficult to evolve!) for such basic operation.

40
Bugs and fixes / Is it an intra-DNA conditions bug RESOLVED (BY DESIGN)
« on: November 28, 2007, 07:03:51 PM »
Here is a severely mutilated Animal Minimalis:
Code: [Select]
cond
start
*.eye5 0 == *.refeye *.myeye == or 314 rnd .aimdx store
stop
I think I didn't do any mistakes. But this doesn't work as expected. If you placed this cripple near Alga Minimalis, for instance, it should stop rotating, in theory. But it doesn't, as for 2.43t. Is it a bug in DB or in my head?

41
Simulation Emporium / The Zen Challenge
« on: November 27, 2007, 11:47:42 PM »
I didn't feel it was hard
Here comes Tao (200 bytes). Beats Origami in F1 Contest easily.
Code: [Select]
start
.tie inc
*.maxvel dup sqr .up store
*.eye4 *.eye6 sub .aimsx store
*.tiepres .tienum store
*.myeye div dup - .tieval store
dup dup mult *.nrg sub - sgn sqr mult .repro store
.tieloc dec

42
Suggestions / Gene structure - cond start stop
« on: November 27, 2007, 10:57:09 AM »
Is there a way to clear the boolean stack within a gene's body?

43
DNA Tools / How DNA works
« on: November 27, 2007, 10:47:18 AM »
Quote from: EricL
Yes, exactly.  Check out this topic.
Cool! I think, it means I can make Sanger do if-then-else blocks without limitations!

44
DNA Tools / How DNA works
« on: November 27, 2007, 10:40:35 AM »
Quote from: EricL
But gene boundaries implicitly operate on the boolean stack.   A cond statement clears the boolean stack for example (a clear stack is implicitly true).  A start statement is an implicit AND of all arguments on the boolean stack.
Yep, I noticed it already and changed that para. Though it needs to be rewritten again taking into account the cutting edge wisdom

45
DNA Tools / How DNA works
« on: November 27, 2007, 10:33:02 AM »
Quote from: EricL
Code: [Select]
    
      Case 7 'store, inc and dec
        If CurrentFlow = body Or CurrentFlow = ELSEBODY Then
          If CondStateIsTrue Then  ' Check the Bool stack.  If empty or True on top, do the stores.  Don't if False.
            ExecuteStores .DNA(a).value
            If n = robfocus Or Not (rob(n).console Is Nothing) Then rob(n).ga(currgene) = True  'EricL  This gene fired this cycle!  Populate ga()
          End If
        End If
WOW! Does it mean, that
Code: [Select]
*.nrg 20000 > 50 .repro store now works as expected?

Pages: 1 2 [3] 4 5