Last active
January 28, 2017 01:23
-
-
Save welkerc/962c18c1c75e038d57698ed8d660388d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: 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