It should be good if the computer could evaluate a
random values, giving more weigth to the right answer.
The weight will decrease with the level, adding more
indecision. Then, a low probability "random" errors
could add more reality.
For example (sample pseudo code):
example: assume rightanswer = 2
//first evaluate the height of the right answer bar (0-
100)
//the lower height for right answer is: 26, max 100
rightheight = random(74)+26;
//Then increase it when the level is lower
rightheight += random((15-level)*3); //inc 0..45
if (rightheight > 100) rightheight = 100;
//Evaluate other questions
heighterror1 = random(100-rightheight);
heighterror2 = random(100-rightheight-heighterror1);
heighterror3 = 100-rightheight-heighterror1-
heighterror2;
//now introduce instability
//check if we'll give a correct answer or not
error = random(level);
if (error > 5) { //change this to introduce more/less
instability
rightanswer += random(4);
if (rightanswer > 3) rightanswer -= 4;
}
//Now we have 4 percent values and which position will
show the right one