15 lines
232 B
Swift
15 lines
232 B
Swift
|
|
extension Int {
|
|
|
|
static func random() -> Int {
|
|
random(in: Int.min...Int.max)
|
|
}
|
|
|
|
mutating func increment(_ increment: Bool) {
|
|
guard increment else {
|
|
return
|
|
}
|
|
self += 1
|
|
}
|
|
}
|