예제 #1
0
        private async Task <IEquation> Generate(Homogeneous hg)
        {
            var ran             = new Random();
            var generator       = new RandomFunctionGenerator(new HomogeneousTreeStrategy());
            var equationHandler = new SolverHandler();

            hg.Equation = "(" + generator.Generate("y/x", (1 + 2 * ran.Next(1, 2))) + ")" + "/" + "(" + generator.Generate("y/x", (1 + 2 * ran.Next(1, 2))) + ")" + "=" + "dydx";
            hg          = (Homogeneous)await equationHandler.SolveAndScramble(hg);

            return(hg);
        }
예제 #2
0
        private async Task <IEquation> Generate(SeparableVariables sv)
        {
            var ran             = new Random();
            var generator       = new RandomFunctionGenerator(new SeparableTreeStrategy());
            var equationHandler = new SolverHandler();

            sv.Equation = "(" + generator.Generate("x", ran.Next(4, 10)) + ")" + "*" + "(" + generator.Generate("y", ran.Next(4, 10)) + ")" + "=" + "dydx";
            sv          = (SeparableVariables)await equationHandler.SolveAndScramble(sv);

            return(sv);
        }