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()); }
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()); }