Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace NewNamespace
- {
- class Program
- {
- static void Main(string[] args)
- {
- ConsoleKeyInfo key;
- int x = 0, y = 0;
- do
- {
- Console.Clear();
- Console.SetCursorPosition(x, y);
- Console.WriteLine("@");
- key = Console.ReadKey();
- if (key.Key == ConsoleKey.LeftArrow) x--;
- if (key.Key == ConsoleKey.RightArrow)x++;
- if (key.Key == ConsoleKey.UpArrow) y--;
- if (key.Key == ConsoleKey.DownArrow) y++;
- if (x < 0) x = 0;
- if (y < 0) y = 0;
- }
- while (key.Key != ConsoleKey.Escape);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement