Created
          December 13, 2016 04:19 
        
      - 
      
- 
        Save nyarly/5f59c06e480c9e5ce86df8af10f44968 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function buildStandardMatch(field, hasValue, value, otherField) { | |
| return function(person) { | |
| if (person[field] == value) == hasValue) { | |
| return person[otherField] | |
| } else { | |
| return 0 | |
| } | |
| } | |
| } | |
| religiousFreedom = { | |
| match: buildStandardMatch("religion", 0, "christianity", "loyalty"), | |
| } | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
function valuation(person,coreValue,secondaryValue,conditionalValue,condition,bool,key) {
var issueStrength = person.values[coreValue] * 2 ;
if (secondaryValue !=== undefined) {
issueStrength += person.values[secondaryValue];
} else if ((person[condition].name === key) === bool) {
issueStrength += person.values[conditionalValue];
}
return issueStrength;
}