Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


2009 summer exams: skeleton program in

bazbazbazbaz Member Posts: 1
can you please help me fix up this code today? i got my exam tomorrow pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee? i dont know what to do..
Module Module1
Dim NewPhrase As String
Dim PhraseHasBeenSet As Boolean
Dim PhraseGuessed As Boolean
Dim Choice As Integer
Dim IndividualLettersArray(20) As Char
Dim GuessStatusArray(20) As Char
Dim LettersGuessedArray(26) As Char
Dim NextGuessedLetter As Char
Dim Index As Integer

Sub DisplayMenu()
Console.WriteLine("1. SETTER - Makes new word/phrase")
Console.WriteLine("2. USER - Next letter guess")
Console.WriteLine("5. End")
End Sub
Sub Main()
PhraseHasBeenSet = False
Call DisplayMenu()
Console.Write("Choice? ")
Choice = Console.ReadLine
If Choice = 1 Then
NewPhrase = GetNewPhrase()
SetUpGuessStatusArray(NewPhrase, IndividualLettersArray, GuessStatusArray)
PhraseHasBeenSet = True
End If
If Choice = 2 Then
If PhraseHasBeenSet = True Then
DisplayCurrentStatus(Len(NewPhrase), GuessStatusArray)
NextGuessedLetter = GetNextLetterGuess()
' is this letter present ?
For Index = 1 To Len(NewPhrase)
If NextGuessedLetter = IndividualLettersArray(Index) Then
GuessStatusArray(Index) = NextGuessedLetter
End If
DisplayCurrentStatus(Len(NewPhrase), GuessStatusArray)
PhraseGuessed = AllLettersGuessedCorrectly(GuessStatusArray, NewPhrase, _
If PhraseGuessed = True Then
Console.WriteLine("You have guessed correctly")
End If
Console.WriteLine("The setter has not specified the word/phrase ..")
End If
End If
If Choice = 5 And PhraseGuessed = False Then
Console.WriteLine("You have not completed this word/phrase...Press return to exit")
End If
Loop Until Choice = 5
End Sub
Function GetNewPhrase() As String
Dim PhraseOK As Boolean
Dim ThisNewPhrase As String
Console.Write("Key in the new phrase
Sign In or Register to comment.