mardi 7 mars 2017

Picking an item out of array and comparing the item name agains another

I am trying to pick an item out of an array at random and then comparing it to another item fram another array, but i just get the int not the word. How to i use the word to compare? Example: var cardArray = ["card1", "card2", "card3", "card4", "card5"]

let rightNumber = Int(arc4random_uniform(UInt32(rightCardValue))) let rightCardValue = cardArray.count

// rightNumber is now an Int, but i need the to compare the word to another random number from another array

Any idea?




Aucun commentaire:

Enregistrer un commentaire