Created
December 26, 2015 00:05
-
-
Save beratdogan/779af5ccfd1acf7cfcd4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Module VBModule | |
Sub Main() | |
Dim x As Integer = 0 | |
Dim y As Integer = 0 | |
Dim input As ConsoleKeyInfo | |
Do | |
input = Console.ReadKey(True) | |
If input.Key = ConsoleKey.LeftArrow Then | |
x = x - 1 | |
If x < 0 Then | |
x = 0 | |
End If | |
ElseIf input.Key = ConsoleKey.RightArrow Then | |
x = x + 1 | |
ElseIf input.Key = ConsoleKey.UpArrow Then | |
y = y - 1 | |
If y < 0 Then | |
y = 0 | |
End If | |
ElseIf input.Key = ConsoleKey.DownArrow Then | |
y = y + 1 | |
End If | |
Console.Clear() | |
Console.SetCursorPosition(x, y) | |
Console.Write("*") | |
Loop While input.Key <> ConsoleKey.Escape | |
Console.Clear() | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment