Reply
Old 05-01-2013, 02:06 PM   #1 (permalink)
 
Status: Junior Member
Posts: 19



Default make a random sentence appear with 1 random noun, 1 random and 1 random adjective in vb.net

This is my code:

Dim index As Integer

Private Sub bntgo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntgo.Click
Dim StrWords(29) As String 'there will be 30 words, so it needs to be 29 because it starts from 0 to 29 and thats 30.
For index = 0 To 29 ' the index equals the spots or elements that will be used.
StrWords(index) = InputBox("enter 10 nouns, 10 adjectives and 10 verbs:") ' a message box will pop up stating that 10 verbs, 10 nouns and 10 adjectives should be entered for the sentences.
Next
Randomize()






End Sub
Public Sub Nouns()
Randomize()


End Sub
Public Sub Adjectives()
Randomize()


End Sub
Public Sub Verbs()
Randomize()


End Sub



Private Sub bntsen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntsen.Click

lstsen.Items.Add("Longwood (verb) the (adjective) (noun)!") 'when the button is pressed the sentences will appear in the list box

lstsen.Items.Add("The (noun) in café 3(verb)(adjective).") 'when the button is pressed the sentences will appear in the list box

lstsen.Items.Add("The girls will (verb) (adjective) dresses to the the (noun).") 'when the button is pressed the sentences will appear in the list box

lstsen.Items.Add("Students will (verb) (adjective) at the (noun).") 'when the button is pressed the sentences will appear in the list box

lstsen.Items.Add("Students get (Adjective) when their (noun) are (verb) by the staff.") 'when the button is pressed the sentences will appear in the list box

lstsen.Items.Add("Receiving a day of (noun) (verb) me (adjective)!") 'when the button is pressed the sentences will appear in the list box

lstsen.Items.Add("At Freshman orientation students (verb) about the (adjective)(noun)on the roof.") 'when the button is pressed the sentences will appear in the list box

Randomize()





i have the sentences appearing in the list box..and the whole message box working..but i just need to know how to make the noun, verb and adjective appear in the sentence and in the right spot.

please and thank you :)
sakura is offline   Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Random ringing noise from laptop after getting a random phonecall from a random guy that talks a random language.? LarsAndre Programming Languages 2 06-12-2014 02:06 PM
Are online poker hands random or are they coded with algorithms that appear random? Blinkdaylow Coding 1 05-19-2013 02:06 AM
java applet code to create random circles random sizes? EricP Coding 0 02-15-2013 06:05 PM
Write a window program to display random string 20 times with random colors at random positions? Unknown_User Programming 2 08-24-2012 10:38 AM
Generate random number in java using Math.random!!!! Question? Unknown_User Programmer/ Programmers 1 12-19-2011 09:06 AM