Noob here, I am trying to create a card game using a standard deck of 52 cards. Here is the code I would like to make into a func so I dont have to manually write it out every single time. I am creating 5 different players so this would be replicated to other players.
func firstPlayerCardShuffle() {
var firstPlayerCard1Num = (Int(arc4random_uniform(UInt32(13)) + 2))
var firstPlayerCard1Suit = suits[Int(arc4random_uniform(UInt32(suits.count)))]
var firstPlayerCard1 = "\(firstPlayerCard1Num) of \(firstPlayerCard1Suit)"
var firstPlayerCard2Num = (Int(arc4random_uniform(UInt32(13)) + 2))
var firstPlayerCard2Suit = suits[Int(arc4random_uniform(UInt32(suits.count)))]
var firstPlayerCard2 = "\(firstPlayerCard2Num) of \(firstPlayerCard2Suit)"
return(firstPlayerCard1,firstPlayerCard2)
}
Can someone let me know what I'm missing.