예제 #1
0
        static public void GenerateTentame()
        {
            Console.Clear();
            Console.WriteLine("1. Genereer oefententamen");
            var ans    = Console.ReadLine();
            int choice = 0;

            if (int.TryParse(ans, out choice))
            {
                switch (choice)
                {
                case 1:
                    Console.Clear();
                    LaTeXGenerator g = new LaTeXGenerator();
                    g.generateLaTeXExam();
                    ResetToMenu();
                    break;

                default:
                    Console.WriteLine("Deze optie is niet beschikbaar." +
                                      Environment.NewLine + "Druk op een knop om terug te gaan");
                    ResetToMenu();
                    break;
                }
            }
            else
            {
                Console.WriteLine("Vul alstublieft het nummer van de keuze in." +
                                  Environment.NewLine + "Druk op een knop om terug te gaan");
                ResetToMenu();
            }
        }
예제 #2
0
 public static void GenerateTentame()
 {
     Console.Clear();
     Console.WriteLine("1. Genereer oefententamen");
     var ans = Console.ReadLine();
     int choice=0;
     if (int.TryParse(ans, out choice))
     {
         switch (choice)
         {
             case 1:
                 Console.Clear();
                 LaTeXGenerator g = new LaTeXGenerator();
                 g.generateLaTeXExam();
                 ResetToMenu();
                 break;
             default:
                 Console.WriteLine("Deze optie is niet beschikbaar." +
                     Environment.NewLine + "Druk op een knop om terug te gaan");
                 ResetToMenu();
                 break;
         }
     }
     else
     {
         Console.WriteLine("Vul alstublieft het nummer van de keuze in."+
             Environment.NewLine + "Druk op een knop om terug te gaan");
         ResetToMenu();
     }
 }
예제 #3
0
        static void OldMain(string[] args)
        {
            Console.WriteLine("Programme started on "+DateTime.Now.ToString("hh:mm:ss.fff"));
            Console.ReadLine();

            /*
            //TEST CODE FOR CONVERTER
            Tester.testConverter(Tester.TestNDFA());
            Tester.testConverter(Tester.TestNDFA2());
            */
            //TEST CODE FOR CHECKING IF STRING IS ACCEPTED BY DFA/NDFA
            //bool test = Tester.TestNDFA2().acceptString("a");
            //bool test2 = Tester.TestNDFA2().isStringAccepted("bbbbbbbbbbbbbbbbbbbbacd");
            //Tester.generateAutomataImage(Tester.TestNDFA2());
            //Console.WriteLine("String accepted: " + test2.ToString());
            /*
            //TEST CODE FOR GENERATING IMAGES
            Tester.generateAutomataImage(Tester.TestDFA());
            //Tester.generateAutomataImage( Tester.generateAutomataImage() );
            //Tester.generateAutomataImage( Tester.testReverse ( Tester.TestNDFA2() ) );
            //Tester.generateAutomataImage(Tester.testConverter(Tester.TestNDFA2()));
            */

            /*
            //TEST CODE FOR GENERATING RANDOM REGEX
            char[] alfabet = {'a', 'b', 'c', 'd'};
            Console.WriteLine(Tester.generateRandomRegex(alfabet, 10).ToString());
            */

            /*
            //TEST CODE FOR REGEX
            Tester.testRegularExpression();
            */

            //Tester.generateAutomataImage(Tester.testReverse(Tester.TestDFA()));

            //AutomataConverter c = new AutomataConverter();

            //Tester.generateAutomataImage(c.renameStates(c.NDFAToDFA(Tester.TestNDFA2())));
            //Tester.generateAutomataImage(c.renameStates(c.NDFAToDFA(Tester.testReverse(c.NDFAToDFA(Tester.TestNDFA2())))));

            //Tester.generateAutomataImage(c.renameStates(c.NDFAToDFA(Tester.testReverse(c.NDFAToDFA(Tester.testReverse(c.NDFAToDFA(Tester.TestNDFA2())))))));
            //Automata<String> debug = new Automata<string>(c.NDFAToDFA(Tester.testReverse(Tester.TestNDFA2())));
            //debug = c.NDFAToDFA(Tester.testReverse(debug));
            //debug.printTransitions();
            //c.renameStates(debug);

            //TEST CODE FOR Minimalization

            //Tester.generateAutomataImage(Tester.testMinimalization(Tester.TestDFA2()));
            //Tester.generateAutomataImage(Tester.testMinimalization(Tester.TestDFA()));
            LaTeXGenerator g = new LaTeXGenerator();
            g.generateLaTeXExam();

            /*
            //TEST CODE FOR PRINTING GRAMMAR
            Console.Write(Tester.TestNDFA2().getGrammar().toBeautifulString());
            AutomataConverter c = new AutomataConverter();
            Console.WriteLine(c.NDFAToDFA(Tester.TestNDFA2()).getGrammar().toBeautifulString());
            */

            /*
            //TEST CODE FOR THOMPSON
            Tester.testRegularExpressionThompson2();
            */
            Console.WriteLine("Programme successfully stopped on " + DateTime.Now.ToString("hh:mm:ss.fff"));
        }
예제 #4
0
        static void OldMain(string[] args)
        {
            Console.WriteLine("Programme started on " + DateTime.Now.ToString("hh:mm:ss.fff"));
            Console.ReadLine();

            /*
             * //TEST CODE FOR CONVERTER
             * Tester.testConverter(Tester.TestNDFA());
             * Tester.testConverter(Tester.TestNDFA2());
             */
            //TEST CODE FOR CHECKING IF STRING IS ACCEPTED BY DFA/NDFA
            //bool test = Tester.TestNDFA2().acceptString("a");
            //bool test2 = Tester.TestNDFA2().isStringAccepted("bbbbbbbbbbbbbbbbbbbbacd");
            //Tester.generateAutomataImage(Tester.TestNDFA2());
            //Console.WriteLine("String accepted: " + test2.ToString());

            /*
             * //TEST CODE FOR GENERATING IMAGES
             * Tester.generateAutomataImage(Tester.TestDFA());
             * //Tester.generateAutomataImage( Tester.generateAutomataImage() );
             * //Tester.generateAutomataImage( Tester.testReverse ( Tester.TestNDFA2() ) );
             * //Tester.generateAutomataImage(Tester.testConverter(Tester.TestNDFA2()));
             */

            /*
             * //TEST CODE FOR GENERATING RANDOM REGEX
             * char[] alfabet = {'a', 'b', 'c', 'd'};
             * Console.WriteLine(Tester.generateRandomRegex(alfabet, 10).ToString());
             */

            /*
             * //TEST CODE FOR REGEX
             * Tester.testRegularExpression();
             */


            //Tester.generateAutomataImage(Tester.testReverse(Tester.TestDFA()));

            //AutomataConverter c = new AutomataConverter();

            //Tester.generateAutomataImage(c.renameStates(c.NDFAToDFA(Tester.TestNDFA2())));
            //Tester.generateAutomataImage(c.renameStates(c.NDFAToDFA(Tester.testReverse(c.NDFAToDFA(Tester.TestNDFA2())))));

            //Tester.generateAutomataImage(c.renameStates(c.NDFAToDFA(Tester.testReverse(c.NDFAToDFA(Tester.testReverse(c.NDFAToDFA(Tester.TestNDFA2())))))));
            //Automata<String> debug = new Automata<string>(c.NDFAToDFA(Tester.testReverse(Tester.TestNDFA2())));
            //debug = c.NDFAToDFA(Tester.testReverse(debug));
            //debug.printTransitions();
            //c.renameStates(debug);


            //TEST CODE FOR Minimalization

            //Tester.generateAutomataImage(Tester.testMinimalization(Tester.TestDFA2()));
            //Tester.generateAutomataImage(Tester.testMinimalization(Tester.TestDFA()));
            LaTeXGenerator g = new LaTeXGenerator();

            g.generateLaTeXExam();


            /*
             * //TEST CODE FOR PRINTING GRAMMAR
             * Console.Write(Tester.TestNDFA2().getGrammar().toBeautifulString());
             * AutomataConverter c = new AutomataConverter();
             * Console.WriteLine(c.NDFAToDFA(Tester.TestNDFA2()).getGrammar().toBeautifulString());
             */

            /*
             * //TEST CODE FOR THOMPSON
             * Tester.testRegularExpressionThompson2();
             */
            Console.WriteLine("Programme successfully stopped on " + DateTime.Now.ToString("hh:mm:ss.fff"));
        }