Last active
February 13, 2019 18:10
-
-
Save patricksimpson/720c772402f4b7e13e07a37f541b465a to your computer and use it in GitHub Desktop.
Car Expert - Decision Tree
This file contains 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
/* | |
* key: 'unqiue_key' | |
question: 'string', | |
responses: [{ | |
response: 'positive', | |
answer: 'battery_terminal' | |
}], | |
*/ | |
const carExpert = [{ | |
key: 'start', | |
question: 'Is the car silent when you turn the key?', | |
responses: [ | |
{ | |
response: 'positive', | |
answer: 'battery_terminal' | |
}, | |
{ | |
response: 'negative', | |
answer: 'clicking_noise' | |
} | |
] | |
}, | |
{ | |
key: 'battery_terminal', | |
question: 'Are the battery terminals corroded?', | |
responses: [ | |
{ | |
response: 'positive', | |
answer: 'clean_terminals' | |
}, | |
{ | |
response: 'negative', | |
answer: 'replace_cables' | |
} | |
] | |
}, | |
{ | |
key: 'clicking_noise', | |
question: 'Does the car make a clicking noise?', | |
responses: [ | |
{ | |
response: 'positive', | |
answer: 'replace_battery' | |
}, | |
{ | |
response: 'negative', | |
answer: 'crank_fail' | |
} | |
] | |
} | |
... | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment