File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Classic Computer Science Problems in Swift.playground/Pages/Chapter 5.xcplaygroundpage Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public protocol Chromosome {
47
47
open class GeneticAlgorithm < ChromosomeType: Chromosome > {
48
48
enum SelectionType {
49
49
case roulette
50
- case tournament( UInt ) // the Int is the number of participants in the tournament
50
+ case tournament( UInt ) // the UInt is the number of participants in the tournament
51
51
}
52
52
53
53
private let threshold : Double // at what fitness level to stop running
@@ -226,7 +226,7 @@ final class SendMoreMoney: Chromosome {
226
226
let more : Int = m * 1000 + o * 100 + r * 10 + e
227
227
let money : Int = m * 10000 + o * 1000 + n * 100 + e * 10 + y
228
228
let difference = abs ( money - ( send + more) )
229
- return 1 / Double( difference + 1 )
229
+ return 1 / Double( difference + 1 )
230
230
}
231
231
return 0
232
232
}
You can’t perform that action at this time.
0 commit comments