Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- ' variables declared. Declared them as "nothing" to avoid an error if the user entered nothing
- Sub Main()
- Dim user As String = Nothing
- Dim pass As String = Nothing
- Dim begin As String = Nothing
- Dim game As String = Nothing
- ' Initial console output. Simple name and password request.
- Console.WriteLine("Enter your name")
- user = Console.ReadLine()
- Console.WriteLine("Enter your password")
- pass = Console.ReadLine()
- ' Simple if else statement. If user = me, or my (ex gf...) AND pass is correct then
- ' proceed. Else end the program. Not sure if thats what "return does in vb'
- If (user = "Sarah" Or user = "Roy") And pass = "buttercup" Then
- Console.WriteLine("Welcome to Visual basic " & user)
- Else
- Console.WriteLine("That username or password is incorrect " & user)
- Console.ReadLine()
- Return
- End If
- ' How to convert the users input to lowercase and just do the one check instead of
- ' yes OR Yes??
- Console.WriteLine("Lets begin shall we?")
- begin = Console.ReadLine()
- If begin = "yes" Or begin = "Yes" Then
- Console.WriteLine("What shall we do first?")
- ' Not sure exactly where I'm going to go from here.
- ' Thought maybe a simple math game? Been trying to sort out
- ' how to record users input to a file? Perhaps a simple
- ' txt file that annotates right or wrong?
- game = Console.ReadLine()
- Else
- Console.WriteLine("Goodbye " & user)
- Console.ReadLine()
- Return
- End If
- Console.ReadLine()
- End Sub
- End Module
Add Comment
Please, Sign In to add comment