'Animal_Minimalis
'By: Nums
'Good for mutation sims and for
'newbies to see how a basic bot works.
'Contains everything necessary for it
'to survive and reproduce.

' Gene 1 Food Finder
cond
 *.eye5 0 >
 *.refeye *.myeye !=
 *.reftype 0 =
start
 *.refveldx .dx store
 *.refvelup 30 add .up store
stop

' Gene 2 Eat Food
cond
 *.eye5 50 >
 *.refeye *.myeye !=
 *.reftype 0 =
start
-1 .shoot store
 *.refvelup .up store
stop

' Gene 3 Avoiding Family
cond
 *.eye5 0 =
 *.refeye *.myeye = or
 *.reftype 0 =
start
 314 rnd .aimdx store
stop

' Gene 4 Reproduce
cond
 *.nrg 20000 >
start
 10 .repro store
stop

cond
start
*.genes *.thisgene *.genes sub sgn 1 add sub .delgene *20 sgn - 1 add mult store
20 inc
*.chlr .rmchlr store
.tie *.refeye *.myeye sgn abs mult inc
*.eye7 *.eye3 sub .aimdx store
10 .up store
0 .aimsx store
50 .mkslime 50 *.slime sub sgn 0 floor mult store
*.thisgene .mkvirus store
1 .vshoot store
stop

'/*****proper reproduction 1

cond
  *.nrg
  20000
  >
start
  50
  .repro
  store
  'if time to reproduce store it
  1
  972
  store
stop

cond
  '/after robot reproduces it reproduces more until energy less then 3000
  *972
  1
  =
start
  50
  .repro
  store
stop

'***** 2

cond
  *.nrg
  3000
  <
start
  0
  972
  store
stop

'Form Schools
''''''''''''''''''''''''''

'too far
cond
*.eye5 0 >
*.refeye *.myeye =
*.refveldx 0 !=
*.refvelup 0 !=
start
*.refveldx .dx store
*.refvelup 10 add .up store
stop

'just right
cond
*.eye5 20 >
*.refeye *.myeye =
*.refveldx 0 !=
*.refvelup 0 !=
start
*.refvelup .up store
stop

'too close
cond
*.eye5 35 >
*.refeye *.myeye =
*.refveldx 0 !=
*.refvelup 0 !=
start
*.refvel 10 sub .up store
stop
''''''''''''''''''''''''''

_



'follow friend if not being shot
cond
*.paralyzed 0 =
*.poisoned 0 =
*.in1 0 !=
*.in2 0 != or
*.memval *.genes =
*.refage 0 >
*.eye5 0 >
*.shflav 0 =
*.shflav -2 = or
start
*.in1 *.in2 angle .setaim store
*.in1 *.in2 dist 500 div *.maxvel mult *.refvel add 0 floor *.maxvel ceil .up store
*.veldx .sx store
stop

-

'follow friend if not being shot
cond
*.paralyzed 0 =
*.poisoned 0 =
*.in1 0 !=
*.in2 0 != or
*.memval *.genes =
*.refage 0 >
*.eye5 0 >
*.shflav 0 =
*.shflav -2 = or
start
*.in1 *.in2 angle .setaim store
*.in1 *.in2 dist 500 div *.maxvel mult *.refvel add 0 floor *.maxvel ceil .up store
*.veldx .sx store
stop

-