int main()
{
char *totalSentances[200];
const char *verb[]={"drove","jumped","ran","walked","skipped","fucked","smoked"};
const char *noun[]={"boy","girl","dog","town","car","ganja","pussy"};
const char *prep[]={"to","from","over","under","before","into","by"};
const char *article[]={"the","a","one","some","any"};
char temp[10],sentance[100]={NULL};
int word_gen,i=0,article_gen,sentance_gen,j=0;
srand(time(0));
for(i=1;i<=200;++i)
{
word_gen=0+rand()%6;
article_gen=0+rand()%4;
strcpy(temp,article[article_gen]);
strcat(sentance,temp);
strcat(sentance," ");
strcpy(temp,noun[word_gen]);
strcat(sentance,temp);
strcat(sentance, " ");
strcpy(temp,verb[word_gen]);
strcat(sentance,temp);
strcat(sentance, " ");
strcpy(temp,prep[word_gen]);
strcat(sentance,temp);
strcat(sentance, " ");
strcpy(temp,article[article_gen]);
strcat(sentance, " ");
strcpy(temp,noun[word_gen]);
strcat(sentance,temp);
totalSentances[i]=sentance;
cout<<sentance<<endl;
*sentance=NULL;
}
int main()
{
char *totalSentances[200];
const char *verb[]={"drove","jumped","ran","walked","skipped","fucked","smoked"};
const char *noun[]={"boy","girl","dog","town","car","ganja","pussy"};
const char *prep[]={"to","from","over","under","before","into","by"};
const char *article[]={"the","a","one","some","any"};
char temp[10],sentance[100]={NULL};
int word_gen,i=0,article_gen,sentance_gen,j=0;
srand(time(0));
for(i=1;i<=200;++i)
{
word_gen=0+rand()%6;
article_gen=0+rand()%4;
strcpy(temp,article[article_gen]);
strcat(sentance,temp);
strcat(sentance," ");
strcpy(temp,noun[word_gen]);
strcat(sentance,temp);
strcat(sentance, " ");
strcpy(temp,verb[word_gen]);
strcat(sentance,temp);
strcat(sentance, " ");
strcpy(temp,prep[word_gen]);
strcat(sentance,temp);
strcat(sentance, " ");
strcpy(temp,article[article_gen]);
strcat(sentance, " ");
strcpy(temp,noun[word_gen]);
strcat(sentance,temp);
totalSentances[i]=sentance;
cout<<sentance<<endl;
*sentance=NULL;
}
To copy to clipboard, switch view to plain text mode
Bookmarks