Suppose we have a class called "Archer"
class Archer {
var Name : String
var Spirit : Double
init(Name : String, Spirit: Double){
self.Name = Name
self.Spirit = Spirit
}
}
And we will make two archers
var Hawkeye = Archer(Name : "Hawkeye", Spirit : 70.00)
var Legolas = Archer(Name : "Logolas", Spirit : 50.00)
We let them duel, and the rule is:
The bigger someones Spirit the more probability he will attack at first in every turn until someone die.
The question is: how to make an algorithm to make a fair fight according to their Spirit?