'Alga_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.

' Genes 1,2,3 viral genes
cond
 *.robage 0 =
start
 7 989 store
stop

cond
 *.vtimer 0 =
start
 3 .mkvirus store
stop

cond
 7 *989 !=
start
 100 .vshoot store
 *.thisgene .mkvirus *.vtimer -1 mult 1 add mult store
 676 .myeye store
 676 *.memloc store
 *.mkvirus 1 add .delgene *.mkvirus *.thisgene sub dup mult sgn mult
 *.thisgene 1 rnd 2 mult -1 add add .delgene store
stop

' Gene 4 food finder
cond
 *.eye5 0 >
 *.refeye *.myeye !=
start
 *.refveldx .dx store
 *.refvelup 30 add .up store
 400 .vshoot store
stop

' Gene 5 eat food
cond
 *.eye5 0 >
 *.refeye *.myeye !=
start
 -6 .shoot store
 *.refvelup 30 add .up store
stop

' Gene 6 shoot back
cond
 *.shflav 0 !=
 *.shflav -2 !=
start
 1256 *.shang sub .aimshoot store
 8 .shootval store
 400 .vshoot store
 0 .shflav store
stop

' Gene 7,8,9,10 avoiance genes
cond
 *.eye5 0 =
 *.refeye *.myeye = or
start
 314 rnd .aimdx store
stop


cond
start
*.refbody 2 div dup
stop

cond
*.eye5 0 >
*.body >
*.refeye 1 >
start
-15 .up store
stop

cond
*.eye5 50 >
*.body >
*.refeye 1 >
start
.setaim .shoot store
*.aim .shootval store
stop

' Gene 11 make shell
cond
 *.shell 250 <
start
 100 .mkshell store
stop

' Gene 12 make slime
cond
 *.slime 100 <
start
 1000 .mkslime store
stop

' Gene 13 reproduce
cond
 *.nrg 15000 >
start
 30 .repro store
stop

end