' - MultiBot Reproduction Genes -
'
' These genes will give you a 2 cell MB
' with one defined as the head and the
' other the tail. Its very basic with
' plenty of possibility for improvement.
' - The Way it Works -
'
' When a MultiBot gains enough energy to reproduce (*.nrg 5000 >), Gene 4 activates and deletes its tie.
' Now that it has no ties (*.numties 0 =), Gene 3 activates making the bot reproduce and define itself as the unfixed Tail.
' The child (*.robage 0 =) makes itself the unfixed Head and ties to its Tail.
' When the tie has hardened (*.multi 1 =), both bots align their ties.
' - Custom Variables -
' *.job is the job of that MB cell
' 1 is Head, 2 is Tail
'
' *.fixtie used for straightening the tie.
' 0 is fixed, 1 is unfixed
def job 50
def fixtie 51
' - Gene 1 -
' Fix the Tie
cond
*.multi 1 =
*.fixtie 1 =
start
1 .tienum store
628 .fixang store
150 .fixlen store
30 .stifftie store
0 .fixtie store
stop
' - Gene 2 -
' Head ties to Tail and gets ready for fixing
cond
*.robage 0 =
start
1 .tie store
1 .job store
1 .fixtie store
stop
' - Gene 3 -
' Lone bot repros the Head bot and gets ready for fixing
cond
*.numties 0 =
*.robage 0 !=
start
50 .repro store
2 .job store
1 .fixtie store
stop
' - Gene 4 -
' Start Repro Loop
cond
*.nrg 5000 >
*.multi 1 =
start
1 .deltie store
stop
end