Exemplo n.º 1
0
        override public string Generate()
        {
            if (numManager.depth > 5)
            {
                return(base.Generate());
            }
            Random num   = new Random();
            int    index = num.Next(0, 3);

            while (index == numManager.adj_rest)
            {
                index = num.Next(0, 3);
            }
            numManager.adj_rest = index;
            if (index == 0)
            {
                numManager.depth++;
                Noun noun = new Noun(numManager);
                return(base.Generate() + " " + noun.Generate());
            }

            if (index == 1)
            {
                numManager.depth++;
                Adj adj = new Adj(numManager);
                return(base.Generate() + " " + adj.Generate());
            }
            return(base.Generate());
        }
Exemplo n.º 2
0
        public string Generate()
        {
            Random num   = new Random();
            int    index = num.Next(0, 3);

            while (index == numManager.line)
            {
                index = num.Next(0, 3);
            }
            numManager.line = index;
            if (index == 0)
            {
                Noun noun = new Noun(numManager);
                return(noun.Generate());
            }
            if (index == 1)
            {
                Prep prep = new Prep(numManager);
                return(prep.Generate());
            }

            Pronoun pronoun = new Pronoun(numManager);

            return(pronoun.Generate());
        }
Exemplo n.º 3
0
        override public string Generate()
        {
            Random num   = new Random();
            int    index = num.Next(0, 3);

            while (index == numManager.prep_rest)
            {
                index = num.Next(0, 3);
            }
            numManager.prep_rest = index;
            if (index == 0)
            {
                Noun noun = new Noun(numManager);
                return(base.Generate() + " " + noun.Generate());
            }

            if (index == 1)
            {
                Pronoun pronoun = new Pronoun(numManager);
                return(base.Generate() + " " + pronoun.Generate());
            }

            Adj adj = new Adj(numManager);

            return(base.Generate() + " " + adj.Generate());
        }