/[hs]/AdviceTree/main.cpp
ViewVC logotype

Contents of /AdviceTree/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Thu Jan 23 17:01:39 2003 UTC (16 years, 10 months ago) by jeremyd
Branch: MAIN
CVS Tags: HEAD
works

1 jeremyd 1.1 //Jeremy Drake
2     //Period 2
3     //AdviceTree
4    
5     #include <iostream.h>
6     #include <apstring.h>
7     #include "adtree.h"
8    
9     int main()
10     {
11     AdTree c;
12     apstring a;
13     c.BuildTheDamnTree();
14     c.GiveAdvice(NULL);
15     apstack<apstring> foo;
16     c.TracePath(NULL, "Jaws", foo);
17     cout << "-------------------------------------------"<<endl;
18     while(!foo.isEmpty())
19     {
20     foo.pop(a);
21     cout << a << endl;
22     }
23     return 0;
24     }
25    
26     /*******************************************************************************
27     * Output:
28     * Do you want to see a romantic movie? y
29     * A classic movie? n
30     * Titanic
31     * -------------------------------------------
32     * Do you want to see a romantic movie? No
33     * Science Fiction? No
34     * Suspense? Yes
35     * Jaws
36     ******************************************************************************/

cvs@jdrake.com
ViewVC Help
Powered by ViewVC 1.1.13