Dim wordlist(20) As String Dim hintlist(20) As String Dim randomNumber, lengthword As Integer Dim letter As String Private Sub Check1_Click() If Check1.Value = 1 Then MsgBox (hintlist(randomNumber)) End If Check1.Value = 0 Check1.Visible = False End Sub Private Sub cmdE_Click() End End Sub Private Sub cmdNW_Click() Check1.Visible = True For y = 0 To 11 Text1(y).Visible = False Text1(y).Text = "" Next y randomNumber = Int(Rnd * 20) 'eventually needs to be changed Print randomNumber, wordlist(randomNumber) lengthword = Len(wordlist(randomNumber)) 'show hint For y = 0 To lengthword - 1 Text1(y).Visible = True Next y p = InStr(1, wordlist(randomNumber), " ") If p <> 0 Then Text1(p - 1).Text = " " End If End Sub Private Sub command1_click(Index As Integer) letter = Command1(Index).Caption Call checkletter End Sub Private Sub Form_Load() Randomize wordlist(0) = "pencil sharpener" wordlist(1) = "workbook" wordlist(2) = "ruler" wordlist(3) = "calculator" wordlist(4) = "binder" wordlist(5) = "notebook" wordlist(6) = "pencil" wordlist(7) = "pen" wordlist(8) = "textbook" wordlist(9) = "chalk board" wordlist(10) = "paper" wordlist(11) = "folder" wordlist(12) = "desk" wordlist(13) = "chair" wordlist(14) = "computer" wordlist(15) = "student" wordlist(16) = "teacher" wordlist(17) = "chalk" wordlist(18) = "keyboard" wordlist(19) = "assignment book" hintlist(0) = "something to sharpen your pencil with" hintlist(1) = "activities in book form" hintlist(2) = "measures objects" hintlist(3) = "calculates math problems" hintlist(4) = "used to store papers or folders in" hintlist(5) = "you take notes in this" hintlist(6) = "you use this to write" hintlist(7) = "you use this to write" hintlist(8) = "gives information on a certain subject" hintlist(9) = "teacher writes on this" hintlist(10) = "something you do assignments on" hintlist(11) = "you store papers in this" hintlist(12) = "you use this to write on" hintlist(13) = "you sit on this" hintlist(14) = "a machine that helps you out with various activities" hintlist(15) = "the people that teachers teach" hintlist(16) = "the person that teaches students" hintlist(17) = "you use this to write on the chalkboard" hintlist(18) = "you use this to type" hintlist(19) = "used to keep track of assignments" End Sub Public Sub checkletter() Dim guess As Boolean guess = False Dim p, start As Integer start = 1 p = 0 For y = 1 To lengthword p = InStr(start, wordlist(randomNumber), letter, 1) start = p + 1 If p > 0 Then guess = True Text1(p - 1).Text = letter End If Next y 'if you miss it then it will add parts to hangman add here 'If guess = False Then 'count If guess = False Then d = guess For d = 1 To 6 For x = d To 1 Step -1 Select Case x Case 1 Image1.Visible = True Case 2 Image2.Visible = True Case 3 Image3.Visible = True Case 4 Image4.Visible = True Case 5 Image5.Visible = True Case 6 Image6.Visible = True End Select Next x Next d End If End Sub
Admin Edit: Please use code tags when posting your code. Code tags are used like so =>

New Topic/Question
Reply




MultiQuote





|