Skip to content

Instantly share code, notes, and snippets.

@welkerc
Last active January 28, 2017 01:23
Show Gist options
  • Save welkerc/962c18c1c75e038d57698ed8d660388d to your computer and use it in GitHub Desktop.
Save welkerc/962c18c1c75e038d57698ed8d660388d to your computer and use it in GitHub Desktop.
//: Playground - noun: a place where people can play
import Cocoa
import Darwin
let rank = [1,2,3,4,5,6,7,8,9,10]
let player1 = Int(arc4random_uniform(UInt32(rank.count)))
let player2 = Int(arc4random_uniform(UInt32(rank.count)))
print("Player 1: \(player1)")
print("Player 2: \(player2)")
if player1 == player2 {
print("Tie")
} else if player1 < player2 {
print("Player 2 Wins")
} else if player1 > player2 {
print("Player 1 Wins")
} else {
print("I haven't got a clue...")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment