形式
Plain text
投稿日時
2019-02-08 19:10
公開期間
無期限
  1. using System;
  2. namespace mozgatas
  3. {
  4. class MainClass
  5. {
  6. public static void Main(string[] args)
  7. {
  8. int x = 39;
  9. int y = 10;
  10. alaphelyzet(x,y);
  11. while (true)
  12. {
  13. var b = Console.ReadKey(true);
  14. if (b.Key == ConsoleKey.Escape) break;
  15. if (b.Key == ConsoleKey.RightArrow) x++;
  16. if (b.Key == ConsoleKey.LeftArrow) x--;
  17. if (b.Key == ConsoleKey.UpArrow) y--;
  18. if (b.Key == ConsoleKey.DownArrow) y++;
  19. if (y < 0) y = 0;
  20. if (x < 0) x = 0;
  21. if (y > 22) y = 22;
  22. if (x > 77) x = 77;
  23. alaphelyzet(x, y);
  24. }
  25. }
  26. private static void alaphelyzet(int x, int y)
  27. {
  28. Console.Title = "Retro GAME";
  29. Console.SetWindowSize(80, 24);
  30. Console.SetBufferSize(80, 24);
  31. Console.CursorVisible = false;
  32. Console.Clear();
  33. Console.SetCursorPosition(x, y);
  34. Console.Write('█');
  35. Console.SetCursorPosition(x+1, y);
  36. Console.Write('█');
  37. Console.SetCursorPosition(x, y+1);
  38. Console.Write('█');
  39. Console.SetCursorPosition(x+1, y+1);
  40. Console.Write('█');
  41. }
  42. }
  43. }
ダウンロード 印刷用表示

このコピペの URL

JavaScript での埋め込み

iframe での埋め込み

元のテキスト