Process of Elimination Quiz for Food Recommendation

I’m trying to figure out the best way to code this. Basically, the MC is going to go to an ice cream store, but all the flavors aren’t in her native language. So I want the LI to ask her a series of questions to figure out what she should get. Questions like: Do you have allergies? A) No, B) Nuts, C) Dairy. And then based on how the player answered, some of the flavors would would be eliminated from the list until they got to one answer. Kind of a food 20 questions.

Anyone know the best way to code this?

2 Likes

This thread should help you!!

2 Likes

Sounds fun! I would probably do this using nested choices, though I’m sure you could also achieve it using a points system or labels. I wrote up a code for you, if you use it, please credit @rachelonepisode on Instagram, even if you change some of the questions.

For this, I picked 16 flavours split into four categories:

Sorbet - Lemon, Kiwi, Acai Berry, Lime
Fruit - Strawberry, Blueberry, Orange, Pineapple
Chocolate - Chocolate Chip Cookie Dough, Cookies ‘n Cream, Chocolate, Fudge
Nuts - Moose Tracks, Pistachio, Peanut Butter Cup, Pralines n’ Cream

For each question asked, you will eliminate a certain amount of flavours. The first choice will eliminate 8, then 4, then 2, and then your final choice, so the player will be asked four questions total. The key here is finding common traits between the flavours in increasingly smaller and smaller categories. You’ll see what I mean in my code below.

Summary

CHAR1
Do you want something fruity?
choice “Yes.” {

#the nut and chocolate categories are eliminated

    CHAR1
Do you want sorbet?

choice “Yes.” {

#the fruit category is eliminated

    CHAR1
Do you want something sour?

choice “Yes.” {

#the kiwi and acai berry flavours are eliminated

    CHAR1
Do you want Lemon or Lime?

choice “Lemon.” {

#LEMON

} “Lime.” {

#LIME

}

} “No.” {

#the lemon and lime berry flavours are eliminated

    CHAR1
Do you want Acai Berry or Kiwi?

choice “Acai Berry” {

#ACAI BERRY

} “Kiwi” {

#KIWI

}
}

} “No.” {

#the sorbet category is eliminated

    CHAR1
Do want something with a berry?

choice “Yes.” {

#pineapple and orange are eliminated

    CHAR1
Do you want Strawberry or Blueberry?

choice “Stawberry.” {

#STRAWBERRY

} “Blueberry.” {

#BLUEBERRY

}

} “No.” {

#strawberry and blueberry are eliminated

    CHAR1
Do you want Pinaepple or Orange?

choice “Pineapple.” {

#PINEAPPLE

} “Orange.” {

#ORANGE

}

}

}

} “No.” {

#the fruit and sorbet categories are eliminated

    CHAR1
Do you want something with nuts?

choice “Yes.” {

#the chocolate category is eliminated

    CHAR1
Do you want something with peanut butter?

choice “Yes.” {

#pralines n cream and pistachio is eliminated

    CHAR1
Do you want Moose Tracks or Peanut Butter Cup?

choice “Moose Tracks.” {

#MOOSE TRACKS

} “Peanut Butter Cup” {

#PB CUP

}

} “No.” {

#moose tracks and PB cups is eliminated

    CHAR1
Do you want Pralines 'n Cream or Pistachio?

choice “Pralines 'n Cream” {

#P 'n C

} “Pistachio” {

#pistachio

}

}

} “No.” {

#the nut category is eliminated

    CHAR1
Do you want something with cookie pieces?

choice “Yes.” {

#chocolate and fudge are eliminated

    CHAR1
Do you want Chocolate Chip Cookie Dough or Cookies 'n Cream?

choice “Chocolate Chip Cookie Dough.” {

#CHOC CHIP COOKIE DOUGH

} “Cookies 'n Cream.” {

#COOKIES N CREAM

}

} “No.” {

#chocolate chip cookie dough and cookies n cream are eliminated

    CHAR1
Do you want Chocolate or Fudge?

choice “Chocolate.” {

#CHOCOLATE

} “Fudge.” {

#FUDGE

}

}

}

}

Let me know if you have any questions!

3 Likes