I am making a console maths test that asks a few random addition, subtraction, multiplication, division, power and square-root questions based on the difficulty level the user chooses!
Here is my code:
using System;
using System.Collections.Generic;
namespace mathstester
{
class Program
{
public enum UserDifficulty
{
Easy,
Normal,
Hard
}
public static void Main(string[] args)
{
Dictionary<string, UserDifficulty> difficultyDictionary = new Dictionary<string, UserDifficulty>();
difficultyDictionary.Add("E", UserDifficulty.Easy);
difficultyDictionary.Add("N", UserDifficulty.Normal);
difficultyDictionary.Add("H", UserDifficulty.Hard);
string userInputDifficulty;
do
{
Console.WriteLine("What difficulty level would you like to do! Please type E for Easy, N for Normal and H for hard");
userInputDifficulty = Console.ReadLine().ToUpper();
} while (userInputDifficulty != "E" && userInputDifficulty != "N" && userInputDifficulty != "H");
UserDifficulty userDifficulty = difficultyDictionary[userInputDifficulty];
}
}
}
However, I am trying to make my code more advanced by automatically setting the difficulty to the harder level or easier level the next time he runs the code depending on what score he got the last time he did the test. For example, if he chose the Normal level and gets a score of 1/10, the next time he runs the code he should automatically be doing the easy level.
But I don't know where to start.
It would really help if someone could show me how I would begin!
Btw if you can think of a better title, please edit it!