root/as3/GameAI/trunk/src/TreeTest.as

リビジョン 1371, 0.6 kB (コミッタ: hael, コミット時期: 3 年 前)

--

Line 
1 package
2 {
3         import flash.display.Sprite;
4        
5         import jp.dip.hael.gameai.graph.searcher.*;
6         import jp.dip.hael.gameai.tree.Tree;
7         import jp.dip.hael.gameai.tree.TreeNode;
8
9         public class TreeTest extends Sprite
10         {
11                 public function TreeTest()
12                 {
13                         var t:Tree = new Tree();
14                         t.idxDomino(
15                                 [0, 1, [2, 3]],
16                                 [1, 2, [4, 5]],
17                                 [1, 3, [6, 7, 8],
18                                 [2, 4, [9, 10],
19                                 [2, 5, [11, 12],
20                                 [3, 7, [13, 14]]]]]);
21                         trace(t.rootIndex == 0);
22                         for(var i:int = 0; i <= 8; i++){
23                                 trace(i, t.parentIndex(i), t.childNodeIndexs(i), t.hasChild(i));
24                         }
25                 }
26                
27         }
28 }
29
30
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。