Skip to content

Commit 32fbf69

Browse files
committed
comment typo fix
1 parent 5a7ca8c commit 32fbf69

File tree

1 file changed

+2
-2
lines changed
  • Classic Computer Science Problems in Swift.playground/Pages/Chapter 5.xcplaygroundpage

1 file changed

+2
-2
lines changed

Classic Computer Science Problems in Swift.playground/Pages/Chapter 5.xcplaygroundpage/Contents.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public protocol Chromosome {
4747
open class GeneticAlgorithm<ChromosomeType: Chromosome> {
4848
enum SelectionType {
4949
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
5151
}
5252

5353
private let threshold: Double // at what fitness level to stop running
@@ -226,7 +226,7 @@ final class SendMoreMoney: Chromosome {
226226
let more: Int = m * 1000 + o * 100 + r * 10 + e
227227
let money: Int = m * 10000 + o * 1000 + n * 100 + e * 10 + y
228228
let difference = abs(money - (send + more))
229-
return 1/Double(difference + 1)
229+
return 1 / Double(difference + 1)
230230
}
231231
return 0
232232
}

0 commit comments

Comments
 (0)