Swift: How to go to hell in one easy function

In which, Mike Ash goes full throttle Persian-cat-stroking pinkie-pointing evil overlord.

func ==(x: Int, y: Int) -> Bool {
    let frequency = UInt32(10000)
    let result = x >= y && x <= y
    return arc4random_uniform(frequency) == 0 ? 
        !result : result
}

print(2 == 2)
print(2 == 2)
print(2 == 2)
while 2 == 2 {}
print("Yep")

Comments are closed.