Module Module1 Sub Main() Dim FileLoad As IO.StreamReader Dim WordsFile(10) As String Dim CluesFile(3) As String Dim PlayerLetters As String Dim PlayerSymbols As String Dim letters(26, 2) As String Dim temp As String Dim UsedHint As String 'Hands over the words file to the StreamReader Function. FileLoad = New IO.StreamReader("H:\KS4\Year 11\Computer Science\words.txt") 'This reads the Encrypted words from the Words file. For x = 1 To 10 WordsFile(x) = FileLoad.ReadLine Next 'This will close the file FileLoad.Close() For x = 1 To 10 Console.WriteLine(x & ". " & WordsFile(x)) Next 'Loads the clues file into StreamReader Function. FileLoad = New IO.StreamReader("H:\KS4\Year 11\Computer Science\clues.txt") 'This reads the Clues from the clues file. For x = 1 To 3 CluesFile(x) = FileLoad.ReadLine Next Console.WriteLine("Would you like to use clues if so press Enter!") Console.ReadLine() FileLoad.Close() 'The puzzle writes this line in the game. Console.WriteLine("Here are the clues, use them wisely...") For x = 1 To 3 Console.WriteLine(CluesFile(x)) Next Console.ReadLine() Console.WriteLine("The clues have now been subsutted into the puzzel!") For x = 1 To 10 For y = 1 To (CluesFile.Length - 1) temp = CluesFile(y) PlayerLetters = temp.Chars(0) PlayerSymbols = temp.Chars(1) WordsFile(x) = Replace(WordsFile(x), PlayerSymbols, PlayerLetters) For z = 1 To 26 If letters(z, 1) = PlayerLetters Then letters(z, 2) = PlayerSymbols End If Next Next Next For x = 1 To 10 Console.WriteLine(x & ", " & WordsFile(x)) Next UsedHint = True Console.ReadLine() End Sub End Module
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)