Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp3
- {
- class Program
- {
- public string Nazwa(string par1, int par2) => par1 + par2.ToString();
- delegate void zdeleg(string cokolwiek);
- public static Dictionary<int, string> RootKey = new Dictionary<int,string>
- {
- {0, "A"},
- {1, "A#"},
- {2, "B"},
- {3, "C"},
- {4, "C#"},
- {5, "D"},
- {6, "D#"},
- {7, "E"},
- {8, "F"},
- {9, "F#"},
- {10, "G"},
- {11, "G#"}
- };
- static void Main(string[] args)
- {
- Console.WriteLine("Daj akord: ");
- var input = Console.ReadLine().ToUpper();
- var inputSplitted = input.Split('-').ToList();
- var inputFirstNumber = RootKey.First(x => x.Value == inputSplitted.First()).Key;
- Console.WriteLine(inputFirstNumber);
- Console.ReadLine();
- Dictionary<int, string> copyRootKey = new Dictionary<int, string>(RootKey);
- var index = 0;
- foreach (var item in copyRootKey)
- {
- if (inputFirstNumber >= index)
- {
- copyRootKey[item.Key] = RootKey[item.Key - inputFirstNumber];
- }
- if (inputFirstNumber < index)
- {
- copyRootKey[item.Key] = RootKey[RootKey.Last().Key - inputFirstNumber + index];
- }
- index++;
- }
- foreach (var note in copyRootKey)
- {
- Console.WriteLine(note.Key + " " + note.Value);
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement