Ejemplo n.º 1
0
        static void runSession(Session session, uint questions)
        {
            for (uint i = 0; i < questions; i++)
            {
                session.PrintProblem();
                session.ReadAnswer();
            }

            session.PrintResults();
        }
Ejemplo n.º 2
0
        static void processChoice(object menu, object choice)
        {
            Configuration config = (Configuration)choice;

            Session session = new Session();
            session.Generator.Operation = config.Operation;
            session.Generator.Constraints = config.Constraints;
            session.Generator.LeftDigits = (config.LeftDigits == null) ? Menu.SolicitValue("Left Digits") : (uint)config.LeftDigits;
            session.Generator.RightDigits = (config.RightDigits == null) ? Menu.SolicitValue("Right Digits") : (uint)config.RightDigits;
            session.Vertical = config.SkipVerticalPrompt ? true : Menu.SolicitFlag("Vertical");

            runSession(session, config.NumberOfQuestions == null ? Menu.SolicitValue("Questions") : (uint)config.NumberOfQuestions);
        }