score = (x) -> if x == "Yes" 10 else 0 weights = (1/3 for i in [0...3]) living_wage = [targets, determination, business_relationship_support] weights.reduce((weighted_sum, weight, index) -> weighted_sum + weight*score(living_wage[index]) , 0)