Category : Science and Education
Archive   : BIOMRF.ZIP
Filename : MUTATE.INC
Output of file : MUTATE.INC contained in archive : BIOMRF.ZIP
' This calculates the gene for mutation and the mutation occurring
'
' The routine takes as parameters the array holding the biomorphs, which has
' biomorphs%(x%,y%) where x% is the biomorph & y% is the gene; and popn%,
' the number of biomorphs. This also takes care of limits such as the max.
' no. of offspring (gene 1) being 16 and no value can be < 1
SUB MUTATE(biomorphs%(2),popn%)
local mut.gen,mg%,bio%
randomize timer
for bio% = 1 to popn%
mut.gen = rnd
mg% = int(mut.gen*9)+1
mut.gen = rnd
if mut.gen < 0.5 then
biomorphs%(bio%,mg%) = biomorphs%(bio%,mg%) - 1
if biomorphs%(bio%,mg%) = 0 then
biomorphs%(bio%,mg%) = 2
end if
else
biomorphs%(bio%,mg%) = biomorphs%(bio%,mg%) + 1
end if
if biomorphs%(bio%,1) = 17 then biomorphs%(bio%,1) = 16
if biomorphs%(bio%,2) = 11 then biomorphs%(bio%,2) = 10
if biomorphs%(bio%,3) = 9 then biomorphs%(bio%,3) = 8
if biomorphs%(bio%,4) = 9 then biomorphs%(bio%,4) = 8
next bio%
end sub
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/