- Customizable Phrase Generator
- 07 Apr 2015 07:00:23 pm
- Last edited by Michael2_3B on 03 May 2015 02:57:25 pm; edited 3 times in total
Edit: This has been completed. <<Download>>
I'm experimenting with sentence generators. Currently, I only have one definite sentence structure, which is:
article + adjective + noun + verb + preposition + article + adjective + noun
adding different structures would make my program a lot longer. The current program generates some grammatical/syntax errors. Here's the current code:
Code:
and the sentence is stored in Str9.
Note: this is not optimized at all, so sorry about the repetition and stuff.
Some examples of what this code will generate:
- the big mountain jumped through the beautiful child
- the new group moved amid a great space
- a little mountain flew between a big man
- a big pond rode behind the beautiful idea
- the old group ran on the large pond
the generator is completely random, so if you happen to get something offensive or something then you can blame randInt().
Since I can't add every word in the dictionary, one of the things I am still wanting to add is the ability to teach the calculator words. so maybe a menu asking for what part of speech your new word is from, and then inputting your word.
I'm experimenting with sentence generators. Currently, I only have one definite sentence structure, which is:
article + adjective + noun + verb + preposition + article + adjective + noun
adding different structures would make my program a lot longer. The current program generates some grammatical/syntax errors. Here's the current code:
Code:
DelVar Z"-->Str9
Lbl 1
randInt(1,2->A
2->B
" the a ->Str8
For(C,1,A-1
1+inString(Str8," ",B->B
End
Str9+" "+sub(Str8,B,inString(Str8," ",B)-B->Str9
randInt(1,13->A
2->B
" beautiful new good old young great big tough small large black white little ->Str8
For(C,1,A-1
1+inString(Str8," ",B->B
End
Str9+" "+sub(Str8,B,inString(Str8," ",B)-B->Str9
randInt(1,28->A
2->B
" person man thing woman child guy family student group problem book room case game idea storm mountain cliff bridge valley grass space cave day life place river pond ->Str8 //see what I did there? ;)
For(C,1,A-1
1+inString(Str8," ",B->B
End
Str9+" "+sub(Str8,B,inString(Str8," ",B)-B->Str9
If Z:Stop
randInt(1,9->A
2->B
" went jumped ran walked swam flew moved looked rode ->Str8
For(C,1,A-1
1+inString(Str8," ",B->B
End
Str9+" "+sub(Str8,B,inString(Str8," ",B)-B->Str9
randInt(1,26->A
2->B
" aboard about above across along alongside amid among around atop behind below between by into near off on onto over past through to up under within ->Str8
For(C,1,A-1
1+inString(Str8," ",B->B
End
Str9+" "+sub(Str8,B,inString(Str8," ",B)-B->Str9
1->Z
Goto 1
and the sentence is stored in Str9.
Note: this is not optimized at all, so sorry about the repetition and stuff.
Some examples of what this code will generate:
- the big mountain jumped through the beautiful child
- the new group moved amid a great space
- a little mountain flew between a big man
- a big pond rode behind the beautiful idea
- the old group ran on the large pond
the generator is completely random, so if you happen to get something offensive or something then you can blame randInt().
Since I can't add every word in the dictionary, one of the things I am still wanting to add is the ability to teach the calculator words. so maybe a menu asking for what part of speech your new word is from, and then inputting your word.