I'm currently working on a Multiple choice quiz program.
I have my arrays:
I also have my booleans:
And then I have my random:
When the form loads, it displays the following code:
optionOne, optionTwo, optionThree, and optionFour are all radiobuttons. As you can see, with the current code, it randomly selects an index value from each Array and displays the text value.
The first part with Textbox1 is fine. Randomly generating an index from the Answers array isn't exactly what I want. I need the options listed to not repeat each other and I need to make sure
that one of the options HAS to be the correct answer. Each symbol must be used at least once and cannot repeat as well. I'm trying to create this program for a friend and I wasn't expecting
this to be as complicated for myself as I had thought.
Anyways, I'm really needing help. If I was unclear on anything, let me know. I can post my source code if needed, but I'm pretty sure that's most of it. Thanks for reading! :)
~S3R0
I have my arrays:
Code:
Dim Symbols() As String = {"あ", "え", "い", "お", "う", "か", "け", "き", "こ", "く", "が", "げ", "ぎ", "ご", "ぐ"}
Dim Answers() As String = {"A", "E", "I", "O", "U", "KA", "KE", "KI", "KO", "KU", "GA", "GE", "GI", "GO", "GU"}
Code:
Dim sym1 As Boolean = False
Dim sym2 As Boolean = False
Dim sym3 As Boolean = False
Dim sym4 As Boolean = False
Dim sym5 As Boolean = False
Dim sym6 As Boolean = False
Dim sym7 As Boolean = False
Dim sym8 As Boolean = False
Dim sym9 As Boolean = False
Dim sym10 As Boolean = False
Dim sym11 As Boolean = False
Dim sym12 As Boolean = False
Dim sym13 As Boolean = False
Dim sym14 As Boolean = False
Dim sym15 As Boolean = False
Code:
Dim MyRandom As New Random
Code:
TextBox1.Text = Symbols(MyRandom.Next(0, Symbols.Length))
optionOne.Text = Answers(MyRandom.Next(0, Answers.Length))
optionTwo.Text = Answers(MyRandom.Next(0, Answers.Length))
optionThree.Text = Answers(MyRandom.Next(0, Answers.Length))
optionFour.Text = Answers(MyRandom.Next(0, Answers.Length))
The first part with Textbox1 is fine. Randomly generating an index from the Answers array isn't exactly what I want. I need the options listed to not repeat each other and I need to make sure
that one of the options HAS to be the correct answer. Each symbol must be used at least once and cannot repeat as well. I'm trying to create this program for a friend and I wasn't expecting
this to be as complicated for myself as I had thought.
Anyways, I'm really needing help. If I was unclear on anything, let me know. I can post my source code if needed, but I'm pretty sure that's most of it. Thanks for reading! :)
~S3R0