We were trying to create a mobile game using Unity 5, and we don't have any idea for what kind of algorithm we're going to use.

Our game is like a logic quiz game, and we want the questions to be randomly picked for the users, in order to enhance their thinking.

What kind of algorithm can be used to have a random selection of question, just like in a quiz game, using Unity 5?

  • \$\begingroup\$ Use a shuffle bag: gamedevelopment.tutsplus.com/tutorials/… \$\endgroup\$ – WeirdElfB0y Nov 1 '16 at 7:54
  • 1
    \$\begingroup\$ I wish questions wouldn't be down-voted with no context! \$\endgroup\$ – Ryan white Nov 1 '16 at 9:18
  • \$\begingroup\$ just this int number = Random.Range(min,max) _ useful link about random algorithm \$\endgroup\$ – Seyed Morteza Kamali Nov 1 '16 at 10:39
  • 2
    \$\begingroup\$ If you read the description on downvote button "This question does not show any research; it is unclear or not useful", I think it is pretty fitting - the author clearly did zero research, moreover they do not specify how exactly they want to choose them(repetition, topics, distribution, etc.). \$\endgroup\$ – wondra Nov 1 '16 at 10:50
  • \$\begingroup\$ See "Randomize a List<T>" on stackoverflow. \$\endgroup\$ – Philipp Nov 4 '16 at 9:45

It's quite a big question.

Short answer. Assign every question a random number, sort the question list, take the top 5.

Long answer. Do as above, remove questions from the list that have been asked in the last N days to stop repeats

Longer answer. Ascertain if the question was good or not (Wheel of fortune asks for a thumbs up / down) and feed this into the ranking selection so popular questions are more likely to be asked.

| improve this answer | |
  • \$\begingroup\$ This looks like the start of a good answer; but it is fairly minimal. Could you go into more detail? Perhaps make each "answer" its own heading, and provide some light pseudo code or more detailed explanation. \$\endgroup\$ – Gnemlock Nov 4 '16 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.