423,688 Members | 1,894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,688 IT Pros & Developers. It's quick & easy.

Need a 3x3 and a 4x4 grid code

P: 3
This is what I have so far, my goal is to get this to display a randomly chosen 3x3 grid of words from Words.txt, which has 10 words, and then will swap one word of those out, note which one it is, then replace it, the grid will be wiped after 30 seconds.
This is what I have so far
Expand|Select|Wrap|Line Numbers
  1. Module Module1
  2.  
  3.  
  4.     Sub Main()
  5.         Dim Choice As Integer
  6.         Dim fileReader As System.IO.StreamReader
  7.         Dim stringreader As String
  8.         Console.ForegroundColor = ConsoleColor.Blue
  9.         Console.WriteLine("For easy mode, type 1, for hard mode type 2")
  10.         Console.WriteLine("Easy mode has a 3x3 grid of words, 4x4 for hard")
  11.         Choice = Console.ReadLine()
  12.  
  13.         Select Case Choice
  14.  
  15.             Case 1 'Easy Mode
  16.                 Console.WriteLine("Hardmode")
  17.                 fileReader =
  18.                 My.Computer.FileSystem.OpenTextFileReader("N:\Controlled Assessment One\WordsEdited.txt")
  19.                 stringreader = fileReader.ReadLine()
  20.                 Console.WriteLine("The first line of the file is " & stringreader)
  21.  
  22.                 Console.Clear() 'Adios, written things
  23.  
  24.                 'Calls up a modified file   fileReader =
  25.                 My.Computer.FileSystem.OpenTextFileReader("N:\Controlled Assessment One\WordsEdited2.txt")
  26.                 stringreader = fileReader.ReadLine()
  27.                 Console.WriteLine("The first line of the file is " & stringreader)
  28.  
  29.                 Console.ReadLine()
  30.             Case 2 'Hard mode
  31.                 Console.WriteLine("Easy Mode")
  32.                 fileReader =
  33.               My.Computer.FileSystem.OpenTextFileReader("N:\Controlled Assessment One\Words.txt")
  34.                 stringreader = fileReader.ReadLine()
  35.                 Console.WriteLine("The first line of the file is " & stringreader)
  36.  
  37.                 Console.Clear() 'Adios, written things.
  38.  
  39.  
  40.                 'Calls up a modified file
  41.                 fileReader =
  42.             My.Computer.FileSystem.OpenTextFileReader("N:\Controlled Assessment One\Words2.txt")
  43.                 stringreader = fileReader.ReadLine()
  44.                 Console.WriteLine("The first line of the file is " & stringreader)
  45.             Case Else
  46.                 Console.WriteLine("Incorrect Output")
  47.         End Select
  48.  
  49.  
  50.         Console.ReadLine()
  51.  
  52.  
  53.     End Sub
  54.  
  55.  
Oct 9 '15 #1
Share this Question
Share on Google+
1 Reply


P: 3
Expand|Select|Wrap|Line Numbers
  1. While Not fileReader.EndOfStream
  2.             For x to 16
  3.  
  4.         End While
  5.  
Trying this
Oct 9 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.