高三上(2012 年 9 月到 10 月)Grade 12, first term (September to October 2012)
Evolution 2012:用 ATCG 基因跑的生態模擬Evolution 2012: an ecosystem simulation run on ATCG genes
說明視窗的第一行是「歡迎使用Evolution 2012 1.0.0.1版」,第二行是「本程式由Majer 與 Star共同製作」。Star 是他的高中同學。開場畫面也寫著同一句英文:Made by Majer & Star。
The first line of the help window reads "歡迎使用Evolution 2012 1.0.0.1版" (welcome to Evolution 2012 version 1.0.0.1) and the second "本程式由Majer 與 Star共同製作" (this program was made by Majer and Star). Star is a high school classmate. The splash screen carries the same sentence in English: Made by Majer & Star.
開場畫面,取自專案的 SplashScreen 資源The splash screen, taken from the project's SplashScreen resource
Each creature has one DNA string, 4,000 letters by default, in the four letters A, T, G and C. The program reads it by looking at what a certain stretch is and how many times a certain fragment occurs: the first few letters set the lifespan, each letter multiplying by a factor (A by 1.5, T by 1.7, G by 1.9, C by 2.1). Red, green and blue each take 8 letters, each letter multiplying by 1, 2, 2.5 or 3, up to 255.
A set of particular fragments act as switches, with names and sequences written in Settings.txt: GCTATA heat tolerance, ATGCAA cold tolerance, TACTGGA half the copy time, CATGACA double life, AGTCGTA predator (can eat others), GTCGTAA double speed, GATCAGA temperature evolution, GATAATAA producer, AGATAGCA two offspring at a time, GGTTACTA double mutation, CTAGAGTA poison and TGAGATCA antidote. A DNA that starts with H followed by 5 letters is a hormone, of five kinds: GAATT, TTAAG, GTATA, TAGGA and GGAAT.
One more fragment is called "外掛DNA" (cheat DNA), and it is his name, MAJER. A creature whose DNA contains those five letters is strengthened in speed, hunting, poison range, heat and cold tolerance and lifespan, once for every time it occurs.
clsEater.vb:DNA 裡含有 MAJER 時的各項加強,MajerNum 是出現次數。clsEater.vb: the boosts when the DNA contains MAJER; MajerNum is the number of occurrences.
環境有溫度、氧氣和二氧化碳。氧氣和二氧化碳一開始各 100,000,生產者(GATAATAA)吸二氧化碳放氧氣,所有生物呼吸時吸氧氣放二氧化碳,兩個動作只是把量在兩種氣體之間搬來搬去。存檔裡每個取樣點的兩者加總都剛好是 200,000。滑鼠可以開伽瑪射線,照到的生物每一次有 1/15 的機率被改掉 DNA 裡的一個字母,小機率還會多插一個或刪掉一個。
The environment has temperature, oxygen and carbon dioxide. Oxygen and carbon dioxide start at 100,000 each. Producers (GATAATAA) take in carbon dioxide and give out oxygen, every creature breathing takes in oxygen and gives out carbon dioxide, the two actions only move the amount from one gas to the other, and in the save files the two add up to exactly 200,000 at every sample. The mouse can switch on a gamma ray; a creature it touches has a 1 in 15 chance each time of having one letter of its DNA changed, and a small chance of an extra letter inserted or one deleted.
'光合作用與呼吸作用
If .Creater Then
If Co2 > 0 Then
Co2 -= .producev + SunE * 0.1
o2 += .producev / 10 + SunE * 0.1
.live += .Consume * 0.1
Else
.live -= .producev
End If
If o2 > 0 Then
o2 -= .Consume * dco2 / 5
Co2 += .Consume * dco2 / 5
.live += .Consume * 0.2
Else
.live -= .Consume / 5
End If
Else
If o2 > 0 Then
o2 -= .Consume * dco2 / 5
Co2 += .Consume * dco2 / 5
.live += .Consume * 0.2
Else
.live -= .Consume / 5
End If
Form1.vb:光合作用與呼吸作用。氧氣減多少,二氧化碳就加多少。Form1.vb: photosynthesis and respiration. Whatever oxygen loses, carbon dioxide gains.
If (gamaray) Then
If touchtest(clsmouse, objeater) Then
objeater.VarPro = 10
If ran.Next(0, VarGamaRay) < 1 Then
Dim p1 As String
Dim p2 As String
Dim num As Integer = ran.Next(0, .DNA.Length)
p1 = .DNA.Substring(0, num)
p2 = .DNA.Substring(num + 1)
Dim ndna As String = p1
ndna += RandomATGC()
If ran.Next(0, VarGamaRay ^ 2) = 0 Then
ndna += RandomATGC()
End If
If ran.Next(0, VarGamaRay ^ 2) = 0 And p2.Length > 0 Then
p2 = p2.Substring(1, p2.Length - 1)
End If
ndna += p2
.DNA = ndna
.live += 3 - ran.Next(0, 10)
.CopyTime += 5 - ran.Next(0, 12)
Form1.vb:伽瑪射線改 DNA。Form1.vb: the gamma ray changing DNA.
The program saves a file every 5,000 time units. A file has four lines, temperature, oxygen, carbon dioxide and population count, with one number every 2 time units. The Save/10-7 folder holds 495 such files, with 3 more odd files such as Save.txt. From the file-name times and how the numbers run on from one file to the next, four windows were running that night, the other three stopped earlier, and the longest ran from 22:52 on 7 October to 18:34 on 8 October, 1,875,000 time units, with the population between 3 and 72. The left half of the figure below is this one.
In all 495 files every sample has oxygen plus carbon dioxide equal to exactly 200,000, and the temperature stays at 20. The right half is the first 20,000 time units of another save on the evening of 9 October (Save/10-9): the temperature climbs from 20 to 1200, the population falls from 50 to single digits, the oxygen drops from about 100,000 to 0, the last stretch of the temperature column is recorded as 0, and the population later returns to between 19 and 26.
存檔畫出來的曲線。欄是兩次執行,列是族群、氧氣、溫度,三列的縱軸兩欄相同。Curves drawn from the save files. Columns are two runs, rows are population, oxygen and temperature, with the same vertical scale in both columns.
The help window also lists shortcuts: Y and U pick two parents, J makes the offspring of the cross, A and S warm or cool by 2 degrees, X sets the temperature, K clears every creature, Q adds a creature with a given gene, G makes random ones, T saves, V imports and P pauses. The project has three folders named with 20121002, 20121012 and 20121019, each holding the source at one point in time.