示例#1
0
 //Purpose:When clicked it will get the next question from the
 //dictionary and output it to the screen
 //Requires: A file to have been opened and a dictonary to have been filled
 //Reutns:Nothing
 private void Next_Question_Button_Click_1(object sender, EventArgs e)
 {
     Question_Box.Clear();
     Answers_Textbox.Clear();
     quesAns = getQuestions.ElementAt <KeyValuePair <string, string> >(random.Next(0, 74));
     Question_Box.AppendText(quesAns.Key);
     Answer_Button.Show();
 }
示例#2
0
        //Purpose: Begins the rounds and gets the first question and tells
        //Player one to go first
        //Requires: Nothing
        //Retuns: Nothing
        private void rounds()
        {
            int index = random.Next(0, 74); //Finds a randon number for the question

            Answer_Button.Show();
            Question_Box.Clear();
            Answers_Textbox.Show();
            //Conditional loop that tells player one they answer first
            while (x < 1)
            {
                Question_Box.AppendText(p1.pName + " you are up first!");
                Question_Box.AppendText("\n\n");
                x += 2;
            }
            //Gets the Question and answer
            quesAns = getQuestions.ElementAt <KeyValuePair <string, string> >(index);
            Question_Box.AppendText(quesAns.Key);
            x = 0;//used to reset the loop back to 0 for the next round
        }