Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Main()
- Dim c1 = New Car()
- Dim c2 = New Car("Toyota", "Matrix", "Red", 2006, 2000)
- c1.Make = "Audi"
- c1.Model = "RS3"
- c1.Color = "New York Taxi Cab Yellow"
- c1.Year = 2019
- c1.Price = 63000
- Console.WriteLine(c1.Make)
- Console.WriteLine(c2.Model)
- Console.WriteLine("Car 1: " & c1.desc)
- Console.WriteLine("Car 2: " & c2.desc)
- c1.versus(c2)
- Dim word = "GEORGE"
- Dim lbl = ""
- Dim done As Boolean = False
- Dim guessed As New ArrayList()
- For Each c As Char In word
- lbl &= "_"
- Next
- Console.WriteLine("Guess: " & lbl)
- Do While Not done
- Console.Write("Guess a letter : ")
- Dim guess = Console.ReadLine()
- Console.Write("Guessed : " & guess)
- lbl = ""
- For Each c As Char In word
- If c = guess.ToUpper() Then
- lbl &= guess.ToUpper()
- guessed.Add(c)
- ElseIf guessed.IndexOf(c) >= 0 Then
- lbl &= c.ToString().ToUpper()
- Else
- lbl &= "_"
- End If
- Next
- Console.WriteLine(vbNewLine & "Guess: " & lbl)
- If (lbl = word) Then
- done = True
- Console.WriteLine("Congrats")
- End If
- Loop
- Console.Read()
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement