示例#1
0
        static bool TestScenario3OK()
        {
            char[] barreChordTest = new char[10];
            char[,] fretBoard = new char[6, 7];
            fretBoard         = BarreChords.String6Major(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[0] = fretBoard[3, 1];
            fretBoard         = BarreChords.String6Minor(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[1] = fretBoard[2, 1];
            fretBoard         = BarreChords.String5Major(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[2] = fretBoard[1, 1];
            fretBoard         = BarreChords.String5Minor(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[3] = fretBoard[1, 2];
            fretBoard         = BarreChords.String6Seventh(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[4] = fretBoard[2, 2];
            fretBoard         = BarreChords.String6MinorSeventh(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[5] = fretBoard[3, 2];
            fretBoard         = BarreChords.String6MajorSeventh(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[6] = fretBoard[3, 2];
            fretBoard         = BarreChords.String5Seventh(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[7] = fretBoard[2, 2];
            fretBoard         = BarreChords.String5MinorSeventh(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[8] = fretBoard[1, 2];
            fretBoard         = BarreChords.String5MajorSeventh(OpenChords.ResetFretBoard(fretBoard));
            barreChordTest[9] = fretBoard[2, 2];
            Random rand = new Random();
            int    k    = rand.Next() % 10;

            return(barreChordTest[k] == '-');
        }
示例#2
0
        static void MediumLevelQuestions(char[,] fretBoard, int fret, ref int correct)
        {
            int    n    = 10;
            Random rand = new Random();

            int[] chosenQuestions = 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 (chosenQuestions[i])
                {
                case 1:
                    fretBoard = BarreChords.String6Major(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans11 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[5, fret + 1], notes[4, fret + 2], notes[5, fret]);
                    int ans12 = int.Parse(Console.ReadLine());
                    if (ans11 != 1 || ans12 != 3)
                    {
                        Console.WriteLine("Wrong answer! This is a E Major shape with root note {0}.", notes[5, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 2:
                    fretBoard = BarreChords.String6Minor(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans21 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[5, fret], notes[4, fret + 2], notes[5, fret + 1]);
                    int ans22 = int.Parse(Console.ReadLine());
                    if (ans21 != 2 || ans22 != 1)
                    {
                        Console.WriteLine("Wrong answer! This is a E minor shape with root note {0}.", notes[5, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 3:
                    fretBoard = BarreChords.String5Major(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans31 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[5, fret], notes[4, fret + 1], notes[4, fret]);
                    int ans32 = int.Parse(Console.ReadLine());
                    if (ans31 != 1 || ans32 != 3)
                    {
                        Console.WriteLine("Wrong answer! This is a A Major shape with root note {0}.", notes[4, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 4:
                    fretBoard = BarreChords.String5Minor(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans41 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[4, fret + 2], notes[4, fret], notes[5, fret]);
                    int ans42 = int.Parse(Console.ReadLine());
                    if (ans41 != 2 || ans42 != 2)
                    {
                        Console.WriteLine("Wrong answer! This is a A minor shape with root note {0}.", notes[4, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 5:
                    fretBoard = BarreChords.String6Seventh(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans51 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[5, fret + 3], notes[5, fret], notes[4, fret + 1]);
                    int ans52 = int.Parse(Console.ReadLine());
                    if (ans51 != 3 || ans52 != 2)
                    {
                        Console.WriteLine("Wrong answer! This is a E7 shape with root note {0}.", notes[5, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 6:
                    fretBoard = BarreChords.String6MinorSeventh(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans61 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[4, fret + 1], notes[4, fret + 3], notes[5, fret]);
                    int ans62 = int.Parse(Console.ReadLine());
                    if (ans61 != 4 || ans62 != 3)
                    {
                        Console.WriteLine("Wrong answer! This is a Em7 shape with root note {0}.", notes[5, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 7:
                    fretBoard = BarreChords.String6MajorSeventh(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans71 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[5, fret], notes[4, fret + 1], notes[5, fret + 4]);
                    int ans72 = int.Parse(Console.ReadLine());
                    if (ans71 != 5 || ans72 != 1)
                    {
                        Console.WriteLine("Wrong answer! This is a Emaj7 shape with root note {0}.", notes[5, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 8:
                    fretBoard = BarreChords.String5Seventh(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans81 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[5, fret + 1], notes[4, fret], notes[4, fret + 2]);
                    int ans82 = int.Parse(Console.ReadLine());
                    if (ans81 != 3 || ans82 != 2)
                    {
                        Console.WriteLine("Wrong answer! This is a A7 shape with root note {0}.", notes[4, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 9:
                    fretBoard = BarreChords.String5MinorSeventh(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans91 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[4, fret], notes[5, fret], notes[5, fret + 2]);
                    int ans92 = int.Parse(Console.ReadLine());
                    if (ans91 != 4 || ans92 != 1)
                    {
                        Console.WriteLine("Wrong answer! This is a Am7 shape with root note {0}.", notes[4, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;

                case 10:
                    fretBoard = BarreChords.String5MajorSeventh(OpenChords.ResetFretBoard(fretBoard));
                    DisplayFretBoard(fretBoard, fret);
                    Console.WriteLine("Which shape is this?" + '\n' + "(1)Major  (2)Minor  (3)Seventh (4) Minor Seventh (5)Major Seventh");
                    int ans101 = int.Parse(Console.ReadLine());
                    Console.WriteLine("Which is the root note?" + '\n' + "(1) {0}  (2) {1}  (3) {2}", notes[4, fret + 2], notes[4, fret], notes[5, fret]);
                    int ans102 = int.Parse(Console.ReadLine());
                    if (ans101 != 5 || ans102 != 2)
                    {
                        Console.WriteLine("Wrong answer! This is a Amaj7 shape with root note {0}.", notes[4, fret]);
                    }
                    else
                    {
                        Console.WriteLine("Correct!");
                        ++correct;
                    }
                    break;
                }
            }
        }