Example #1
0
        static void Main(string[] args)
        {
            List <string> exercisesTypeKeys = ExerGeneratorFactory.GetInstance().GetAllTypes();
            var           firstType         = ExerGeneratorFactory.GetInstance().GetExerciseGenerator(exercisesTypeKeys[0]);

            Console.WriteLine(firstType.GenerateExercises(60));
            //SubstractionUntil100NoConversion sub = new SubstractionUntil100NoConversion();
            //sub.GenerateExercises(72);
            //SubtractionUntil20 subtractionUntil20 = new SubtractionUntil20();
            // subtractionUntil20.GenerateExercises(60);


            //            MultiplactionUntil100 multiplactionUntil100 = new MultiplactionUntil100();
            //            multiplactionUntil100.GenerateExercises(120);
        }
Example #2
0
        private void OnGenerateExerciseClicked(object sender, RoutedEventArgs e)
        {
            int.TryParse(ExerciseNumberTextBox.Text, out int exerNum);

            if (exerNum < 0 || exerNum > 300)
            {
                MessageBox.Show("Please select a number between 0 and 300");
                return;
            }
            IExercise exercise = ExerGeneratorFactory.GetInstance().GetExerciseGenerator(SelectedExerciseType);

            if (exercise == null)
            {
                return;
            }

            string exers = exercise.GenerateExercises(exerNum);

            ResultTextBlock.Text = exers;
        }
Example #3
0
 public AppViewModel()
 {
     ExercisesTypes = ExerGeneratorFactory.GetInstance().GetAllTypes();
 }