1
Suggestions / .refslime, .trefslime
« on: December 06, 2007, 05:12:07 AM »
There are gaps for these sysvars in the bot's memory AFAIK. Is it done intentionally? What's the reason then?
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.
The origin of the eukaryotic cell was a milestone in the evolution of life, since they include all complex cells and almost all multi-cellular organisms.I think it would be a real break-through in Darwinbots design if possibility of endosymbiotic bots were added. Eukaryotic cell became possible when prehistoric cells evolved phagocytosis. Those cells became eukaryotes when they stopped lyse phagocytosed organisms (protokaryotes noticeably cannot do phagocytosis). I suggest to implement phagocytosis in Darwinbots.
always {
*.eye5 > 0 && *.myeye == *.refeye && .aimdx
|| *.eye5 > 30 && .shoot
|| *.refeye != *.myeye && *.eye6 != *.eye4 && .aimdx
|| *.nrg > 20000 && .repro
|| *.vel < 30 && .up
= *.eye5 > 0 && *.myeye == *.refeye && 31
|| *.eye5 > 30 && -1
|| *.refeye != *.myeye && *.eye6 - *.eye4
|| *.nrg > 20000 && 30
|| 30 - *.vel;
}
There is compiled DNA.start
*.eye5 sgn sqr *.myeye *.refeye sub sgn abs -- abs mult 31 mult
dup sgn abs -- abs *.eye5 30 sub sgn sqr -1 mult mult add
dup sgn abs -- abs *.refeye *.myeye sub sgn abs *.eye6 *.eye4 sub mult mult add
dup sgn abs -- abs *.nrg 20000 sub sgn sqr 30 mult mult add
dup sgn abs -- abs 30 *.vel sub mult add
*.eye5 sgn sqr *.myeye *.refeye sub sgn abs -- abs mult .aimdx mult
dup sgn abs -- abs *.eye5 30 sub sgn sqr .shoot mult mult add
dup sgn abs -- abs *.refeye *.myeye sub sgn abs *.eye6 *.eye4 sub sgn abs mult .aimdx mult mult add
dup sgn abs -- abs *.nrg 20000 sub sgn sqr .repro mult mult add
dup sgn abs -- abs 30 *.vel sub sgn sqr .up mult mult add
store
stop
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?
NAME
sanger.pl - Darwinbots DNA macro language interpreter
SYNOPSIS
sanger.pl [file]
sanger.pl -e [code]
sanger.pl --help
DESCRIPTION
Sanger is a macro language designed to make conditionless DNA
construction easier. Sanger is named after Frederick Sanger, inventor
of DNA sequencing.
"sanger.pl" is Sanger interpreter which gives classic low-level DNA code
on output. Sanger code may contain macro definitions and file
inclusions. Everything else is interpreted as instructions, I. e. macro
calls and plain DNA code.
MACROS
Macro definition starts with DEFINE and lasts till a semicolon. Macro
names are case-insensitive.
DEFINE NEZ $1 sgn abs;
DEFINE NE NEZ( $1 $2 sub );
Definition of a macro may contain argument references: $1, $2 and so on.
When macro is called, argument references are replaced with arguments.
For instance,
NE( *.myeye, *.refeye )
is interpreted as
*.myeye *.refeye sub sgn abs
FILE INCLUSIONS
File inclusions start with INCLUDE and last till a semicolon, similar to
macros.
INCLUDE filename;
STANDARD LIBRARY
These macros are found within 'stdlib.dna' file going in distribution.
NOT( boolean )
AND( boolean, boolean )
OR( boolean, boolean )
XOR( boolean, boolean )
Boolean operators.
EQZ( integer )
NEZ( integer )
GTZ( integer )
LTZ( integer )
GEZ( integer )
LEZ( integer )
Compare the top value on the stack with zero.
EQ( integer, integer )
NE( integer, integer )
GT( integer, integer )
LT( integer, integer )
GE( integer, integer )
LE( integer, integer )
Compare two integers on the top of the stack.
TEST( boolean, integer )
If the first argument is true, pushes the second argument on the
stack, otherwise pushes zero.
IF( boolean, integer, integer )
If the first argument is true, pushes the second argument on the
stack, otherwise pushes the third.
EXAMPLES
Lionfish's genes are taken for demonstration.
INCLUDE stdlib.dna;
' Venom blinding and strvenom killer exploit
IF( 1 rnd, IF( 1 rnd, .eye5width, .eye5dir ), .strvenom ) .vloc store
' Selective shooting
DEFINE ENEMY NE( *.in1, *.refage );
IF( GT( *.eye5, 60 ),
IF( NEZ( *.refeye ),
TEST( ENEMY(), -3 ),
-6 ),
TEST( GT( *.nrg, 1000 ), -3 ) ) .shoot store
SEE ALSO
Frederick Sanger
<http://en.wikipedia.org/wiki/Frederick_Sanger>
Lionfish's genes explained
<http://www.darwinbots.com/Forum/index.php?showtopic=2169>
AUTHOR
Ivan Fomichev <ifomichev@gmail.com>
COPYRIGHT
Copyright (C) 2007 Ivan Fomichev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
cond
*.eye5 50 >
*.numties 0 =
start
1 .tie store
1 .tienum store
stop
cond
*.tienum 1 =
start
*.tieang .aimsx store
stop