Public paste
Code
By: Spacey | Date: Sep 29 2006 09:48 | Format: None | Expires: never | Size: 1.38 KB | Hits: 1402

  1. Imports Microsoft
  2. Imports System
  3.  
  4. Module Module1
  5.     Dim Score As Integer
  6.  
  7.  
  8.     Sub Main()
  9.         Console.WriteLine("Welcome to the first version of Spacey's trivia")
  10.  
  11.         Static I As Integer
  12.         I = 0
  13.  
  14.         Static Questions(10) As String
  15.         Questions(1) = "The answer to this question is test"
  16.         Questions(2) = "This is the second question, the answer to this question is test2"
  17.         Questions(3) = "This is the third question, and the answer to this is test3"
  18.  
  19.         Static QAnswers(10) As String
  20.         QAnswers(1) = "Test"
  21.         QAnswers(2) = "Test2"
  22.         QAnswers(3) = "Test3"
  23.  
  24.         Static Question As String
  25.  
  26.         Static QAnswer As String
  27.  
  28.         For I = 1 To 10
  29.             Question = Questions(I)
  30.             QAnswer = QAnswers(I)
  31.             If Input() = QAnswer Then
  32.             Static Input = Console.ReadLine
  33.             Console.WriteLine(Question)
  34.             Input = ""
  35.             Input = Console.ReadLine
  36.             Console.WriteLine("That is the correct answer")
  37.             'I = +1
  38.             Else
  39.             Console.WriteLine("That is incorrect, one point will be subtracted from your score")
  40.             Score = -1
  41.             I = +1
  42.             Console.WriteLine(Question)
  43.             Input = ""
  44.             Input = Console.ReadLine
  45.             End If
  46.         Next I
  47.  
  48.     End Sub
  49.  
  50. End Module
  51.