Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1, num2, num3;

            try
            {
                num1 = Int32.Parse(num1Text.Text);
                num2 = Int32.Parse(num2Text.Text);
                num3 = Int32.Parse(num3Text.Text);

                CheckRunner.CheckAllMethods(num1, num2, num3);
                MessageBox.Show("OK");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            String output = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = output;

            output            = LambdaRunner.RunAllMethods(num1, num2, num3);
            lambdaOutput.Text = output;
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1 = Int32.Parse(num1Text.Text);
            int num2 = Int32.Parse(num2Text.Text);
            int num3 = Int32.Parse(num3Text.Text);

            String output = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = output;

            output            = LambdaRunner.RunAllMethods(num1, num2, num3);
            lambdaOutput.Text = output;
            String[] splittextlambda = lambdaOutput.Text.Split(new string[] { "\n" }, StringSplitOptions.None);
            String[] splittextmethod = methodOutput.Text.Split(new string[] { "\n" }, StringSplitOptions.None);
            bool     ok = true;

            for (int i = 0; i < splittextmethod.Length - 1; i++)
            {
                if (splittextlambda[i].Split(new string[] { " = " }, StringSplitOptions.None).Last() != splittextmethod[i].Split(new string[] { " = " }, StringSplitOptions.None).Last())
                {
                    ok = false;
                    break;
                }
            }
            if (ok)
            {
                System.Windows.Forms.MessageBox.Show("Output ok!");
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Output not ok!");
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1 = Int32.Parse(num1Text.Text);
            int num2 = Int32.Parse(num2Text.Text);
            int num3 = Int32.Parse(num3Text.Text);

            String output = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = output;

            String output2 = LambdaRunner.RunAllMethods(num1, num2, num3);

            lambdaOutput.Text = output2;


            string[]      words    = output.Split('\n');
            string[]      words2   = output2.Split('\n');
            List <String> outputs1 = new List <String>();
            List <String> outputs2 = new List <String>();

            foreach (var word in words)
            {
                outputs1.Add(word.Split('=').Last());
            }
            foreach (var word in words2)
            {
                outputs2.Add(word.Split('=').Last());
            }
            Debug.WriteLine(outputs1.ToString());
            Debug.WriteLine(outputs2.ToString());

            MessageBox.Show(outputs1.SequenceEqual(outputs2).ToString());
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1 = Int32.Parse(num1Text.Text);
            int num2 = Int32.Parse(num2Text.Text);
            int num3 = Int32.Parse(num3Text.Text);

            String output = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = output;

            //Als de checkbox aangeklikt is wordt er bij num1 van de lambda's een andee waarde ingevoerd.
            if (!checkBox1.Checked)
            {
                output            = LambdaRunner.RunAllMethods(num1, num2, num3);
                lambdaOutput.Text = output;
            }
            else
            {
                output            = LambdaRunner.RunAllMethods(999, num2, num3);
                lambdaOutput.Text = output;
            }



            MessageBox.Show(AnswerChecker.CheckAnswers());
        }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1 = Int32.Parse(num1Text.Text);
            int num2 = Int32.Parse(num2Text.Text);
            int num3 = Int32.Parse(num3Text.Text);

            String output = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = output;

            output            = LambdaRunner.RunAllMethods(num1, num2, num3);
            lambdaOutput.Text = output;

            foreach (string s in methodOutput.Lines)
            {
                string[] a = s.Split('=');
                methods.Add(a.Last());
            }

            foreach (string s in lambdaOutput.Lines)
            {
                string[] a = s.Split('=');
                lambdas.Add(a.Last());
            }

            if (uitkomst())
            {
                System.Windows.Forms.MessageBox.Show("gelijk");
            }
        }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1 = Int32.Parse(num1Text.Text);
            int num2 = Int32.Parse(num2Text.Text);
            int num3 = Int32.Parse(num3Text.Text);

            String output = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = output;

            output            = LambdaRunner.RunAllMethods(num1, num2, num3);
            lambdaOutput.Text = output;
        }
Ejemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1 = Int32.Parse(num1Text.Text);
            int num2 = Int32.Parse(num2Text.Text);
            int num3 = Int32.Parse(num3Text.Text);

            String methodOutputString = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = methodOutputString;

            String lambdaOutputString = LambdaRunner.RunAllMethods(num1, num2, num3);

            lambdaOutput.Text = lambdaOutputString;

            if (methodOutputString.Equals(lambdaOutputString))
            {
                MessageBox.Show("Ok");
            }
        }
Ejemplo n.º 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1 = Int32.Parse(num1Text.Text);
            int num2 = Int32.Parse(num2Text.Text);
            int num3 = Int32.Parse(num3Text.Text);

            String output = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = output;

            output            = LambdaRunner.RunAllMethods(num1, num2, num3);
            lambdaOutput.Text = output;

            // Check of de outputs gelijk zijn
            bool result = compareOutput();

            // Toont juiste bericht in een MessageBox
            String outputMessage = result ? "Results OK!" : "Results not OK!";

            System.Windows.Forms.MessageBox.Show(outputMessage);
        }
Ejemplo n.º 9
0
        private void button1_Click(object sender, EventArgs e)
        {
            int num1 = Int32.Parse(num1Text.Text);
            int num2 = Int32.Parse(num2Text.Text);
            int num3 = Int32.Parse(num3Text.Text);

            String output = MethodRunner.RunAllMethods(num1, num2, num3);

            methodOutput.Text = output;

            output            = LambdaRunner.RunAllMethods(num1, num2, num3);
            lambdaOutput.Text = output;

            if (methodOutput.Text.Equals(lambdaOutput.Text))
            {
                MessageBox.Show("Results OK");
            }
            else
            {
                MessageBox.Show("Results not OK!");
            }
        }