コード例 #1
0
ファイル: Program.cs プロジェクト: pkt-fit-knu/I22-15
 private void Round(Node current)
 {
     Console.WriteLine(current.name);
     if (current.children != null)
         foreach (Node a in current.children.Where(a => a != null))
         {
             Round(a);
         }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: pkt-fit-knu/I22-15
 public void Add(string name, List<string> chnames)
 {
     if (root == null)
     {
         root = new Node(name);
         foreach (string a in chnames)
         {
             root.children.Add(new Node(a));
         }
         current = root.children[0];
         father = root;
     }
     else if ((name == "yes") || (name == "no"))
     {
         current.children.Add(new Node(name));
         current.children[0].children = null;
         foreach (Node a in father.children)
         {
             if (a.children.Count == 0)
             {
                 current = a;
                 break;
             }
         }
     }
     else
     {
         current.children.Add(new Node(name));
         father = current;
         current = father.children[0];
         foreach (string a in chnames)
             current.children.Add(new Node(a));
         father = current;
         current = current.children[0];
     }
 }