mirror of
https://github.com/TheUltimateHacker/shiftos-next.git
synced 2025-01-22 16:42:14 +00:00
commit
f9b8f50f27
1 changed files with 11 additions and 28 deletions
|
@ -5,41 +5,24 @@
|
|||
|
||||
Public Sub MQInterpret(question As String, answer As Integer)
|
||||
Dim random As New Random()
|
||||
Private correct As Boolean = False
|
||||
Dim args() As String = question.Replace("What is ", "").Split(" ")
|
||||
Select Case args(1)
|
||||
Case "+"
|
||||
If answer = args(0) + args(2) Then
|
||||
Dim cptoadd As Integer = random.Next(1, 5)
|
||||
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
||||
AddCP(cptoadd)
|
||||
Else
|
||||
AddLine("Incorrect! Better luck next time...")
|
||||
End If
|
||||
correct = (answer = CInt(args(0)) + CInt(args(2)))
|
||||
Case "-"
|
||||
If answer = args(0) - args(2) Then
|
||||
Dim cptoadd As Integer = random.Next(1, 5)
|
||||
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
||||
AddCP(cptoadd)
|
||||
Else
|
||||
AddLine("Incorrect! Better luck next time...")
|
||||
End If
|
||||
correct = (answer = args(0) - args(2))
|
||||
Case "*"
|
||||
If answer = args(0) * args(2) Then
|
||||
Dim cptoadd As Integer = random.Next(1, 5)
|
||||
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
||||
AddCP(cptoadd)
|
||||
Else
|
||||
AddLine("Incorrect! Better luck next time...")
|
||||
End If
|
||||
correct = (answer = args(0) * args(2))
|
||||
Case "/"
|
||||
If answer = args(0) / args(2) Then
|
||||
Dim cptoadd As Integer = random.Next(1, 5)
|
||||
correct = (answer = args(0) / args(2))
|
||||
End Select
|
||||
If (correct) Then
|
||||
AddLine("Correct! You have earned " & cptoadd & " Codepoints!")
|
||||
AddCP(cptoadd)
|
||||
Else
|
||||
AddLine("Incorrect! Better luck next time...")
|
||||
End If
|
||||
End Select
|
||||
MQCreateQuestion()
|
||||
End Sub
|
||||
|
||||
|
|
Loading…
Reference in a new issue