Trying to make a function in Swift Spritekit, this is how it looks like:
func card_vals(card_value_set: [Int], card_set: [String]) {
var card_value_set = card_value_set
var card_set = card_set
for i in card_set {
var j = Int(i[0])
card_value_set.append(j)
}
}
In simple words, the function is taking a card_set, looking like ["3C", "4D"] which is a Str list, and the card_value_set should look like [3,4], which is a Int list. However, I am getting the following error:
cannot convert value of type 'Int' to expected argument type 'Range<String.Index>
Any help to erase this error?
Thanks