Example #1
0
        static bool TestScenario4OK()
        {
            char[,] fretBoard = new char[6, 7];
            int rootString       = 1;
            int sumOfRootStrings = 0;

            fretBoard         = Scales.ReturnAMajorScale(OpenChords.ResetFretBoard(fretBoard), ref rootString);
            sumOfRootStrings += rootString;
            fretBoard         = Scales.ReturnAMinorScale(OpenChords.ResetFretBoard(fretBoard), ref rootString);
            sumOfRootStrings += rootString;
            fretBoard         = Scales.ReturnAMajorPentatonicScale(OpenChords.ResetFretBoard(fretBoard), ref rootString);
            sumOfRootStrings += rootString;
            fretBoard         = Scales.ReturnAMinorPentatonicScale(OpenChords.ResetFretBoard(fretBoard), ref rootString);
            sumOfRootStrings += rootString;
            return(sumOfRootStrings <= 20 && sumOfRootStrings >= 4);
        }
Example #2
0
        static void HardLevelQuestions(char[,] fretBoard, int fret, ref int correct)
        {
            Random rand       = new Random();
            int    rootString = 0;
            int    n          = 4;

            int[] scrambleQuestions = RandomQuestions(n);
            int[] randomFrets       = new int[4];
            string[,] notes = Scales.Notes();
            for (int i = 0; i < 4; ++i)
            {
                randomFrets[i] = rand.Next() % 6 + 1;
            }
            for (int i = 0; i < 4; ++i)
            {
                Console.WriteLine("Question{0}", i + 1);
                fret = randomFrets[i];
                switch (scrambleQuestions[i])
                {
                case 1:
                    fretBoard = Scales.ReturnAMajorScale(OpenChords.ResetFretBoard(fretBoard), ref rootString);
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("What kind of scale is this?" + '\n' + "(1)Major  (2)Minor (3)Major Pentatonic (4)Minor Pentatonic");
                    int ans11 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[rootString, fret + 1], notes[rootString, fret + 2], notes[rootString, fret + 3]);
                    int ans12 = int.Parse(Console.ReadLine());
                    if (ans11 != 1 || ans12 != 1)
                    {
                        Console.WriteLine("Wrong answer! This is a Major scale with root note {0}.", notes[rootString, fret + 1]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 2:
                    fretBoard = Scales.ReturnAMinorScale(OpenChords.ResetFretBoard(fretBoard), ref rootString);
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("What kind of scale is this?" + '\n' + "(1)Major  (2)Minor (3)Major Pentatonic (4)Minor Pentatonic");
                    int ans21 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[rootString, fret], notes[rootString, fret - 1], notes[rootString, fret + 1]);
                    int ans22 = int.Parse(Console.ReadLine());
                    if (ans21 != 2 || ans22 != 3)
                    {
                        Console.WriteLine("Wrong answer! This is a Minor scale with root note {0}.", notes[rootString, fret + 1]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 3:
                    fretBoard = Scales.ReturnAMajorPentatonicScale(OpenChords.ResetFretBoard(fretBoard), ref rootString);
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("What kind of scale is this?" + '\n' + "(1)Major  (2)Minor (3)Major Pentatonic (4)Minor Pentatonic");
                    int ans31 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[rootString, fret + 2], notes[rootString, fret + 1], notes[rootString, fret + 3]);
                    int ans32 = int.Parse(Console.ReadLine());
                    if (ans31 != 3 || ans32 != 2)
                    {
                        Console.WriteLine("Wrong answer! This is a Major pentatonic scale with root note {0}.", notes[rootString, fret + 1]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 4:
                    fretBoard = Scales.ReturnAMinorPentatonicScale(OpenChords.ResetFretBoard(fretBoard), ref rootString);
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("What kind of scale is this?" + '\n' + "(1)Major  (2)Minor (3)Major Pentatonic (4)Minor Pentatonic");
                    int ans41 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[rootString, fret - 1], notes[rootString, fret], notes[rootString, fret + 1]);
                    int ans42 = int.Parse(Console.ReadLine());
                    if (ans41 != 4 || ans42 != 3)
                    {
                        Console.WriteLine("Wrong answer! This is a minor pentatonic scale with root note {0}.", notes[rootString, fret + 1]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;
                }
            }
        }