Do you want a dog or a cat?:
- dog:
- Do you want a small or big dog?:
small:
- Do you want an annoying dog?:
yes: You want a chihuahua.
no: You want a terrier.
big: You want a great dane.
- cat:
- Do you want a small cat or a big cat?:
small: You want to rescue a stray.
big: You want to rescue a lion.
That generates an array with keys that alternate between prompts and possible answers. Any decent freelancer could create a script to turn the array into HTML forms and JavaScript, with plenty of classes and whatnot for you to target with CSS, for several hundred dollars depending on the rest of your specifications.You are not logged in, either login or create an account to post comments
Here's a bunch of tree jargon, which you can feel free to skip, and come back ot if anything below doesn't make sense. A graph is a bunch of nodes connected by edges. A tree is a graph with no loops in it. A rooted binary tree is a tree with a designated root or starting node, where each node has zero or two children. A node is called internal if it has children, and is called a leaf if it has no children.
You just choose a bunch of ways to divide your products in two at each step, and then write a bit of code to do the actually question/answer bit. The depth of the tree is the maximal distance from the root (ie, starting) node. You can have up to 2^(depth) products in your tree. (It's fine, of course, if some branches are shorter than others.)
Presumably you would want each (internal) node to be labeled by a question, with answers associated to each child of the node. Then the leaves are your actual products. So you would have a variable keeping track of Joe's current position in the tree, which moves as he makes his choices.
posted by kaibutsu at 12:45 PM on October 22, 2012 [1 favorite]