コード例 #1
0
ファイル: MainForm.cs プロジェクト: ScanMountGoat/ArcCross
        private void openARCToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog d = new OpenFileDialog())
            {
                d.FileName = "data.arc";
                d.Filter  += "Smash Ultimate ARC|*.arc";
                if (d.ShowDialog() == DialogResult.OK)
                {
                    Cursor.Current = Cursors.WaitCursor;

                    Stopwatch s = new Stopwatch();
                    s.Start();
                    ArcFile.InitFileSystem(d.FileName);
                    System.Diagnostics.Debug.WriteLine("parse arc: " + s.Elapsed.Milliseconds);
                    s.Restart();
                    InitFileSystem();
                    System.Diagnostics.Debug.WriteLine("init nodes: " + s.Elapsed.Milliseconds);
                    s.Restart();

                    Cursor.Current = Cursors.Arrow;
                    label1.Text    = "Arc Version: " + ArcFile.Version.ToString("X");

                    updateHashesToolStripMenuItem.Enabled = false;

                    Version  = ArcFile.Version;
                    FilePath = d.FileName;

                    HashDict.Unload();
                }
            }
        }
コード例 #2
0
        static void Main(string[] args)
        {
            HashDict <char, int> table = new HashDict <char, int>();

            string input = Console.ReadLine();

            foreach (var letter in input)
            {
                if (!table.ContainsKey(letter))
                {
                    table.Add(letter, 1);
                }
                else
                {
                    table[letter]++;
                }
            }

            foreach (var letter in table.Keys)
            {
                Console.WriteLine($"{letter}: {table[letter]} time/s");
            }
            Console.ReadLine();
        }
コード例 #3
0
 public OrderedSet()
 {
     this.set   = new HashDict <T, Node <T> >();
     this.root  = null;
     this.Count = 0;
 }