Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- int x = 0, y = 0;
- while(true)
- {
- ConsoleKeyInfo InputKey = Console.ReadKey();
- switch(InputKey.Key)
- {
- case ConsoleKey.UpArrow:
- y--;
- break;
- case ConsoleKey.DownArrow:
- y++;
- break;
- case ConsoleKey.LeftArrow:
- x--;
- break;
- case ConsoleKey.RightArrow:
- x++;
- break;
- }
- Console.Clear();
- Console.SetCursorPosition(x,y);
- Console.Write(x%2==0 ? '#' : '$');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment