Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.IO;
  4. using System.Text;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7.  
  8. class Player
  9. {
  10. static void Main(string[] args)
  11. {
  12. int firstInitInput = int.Parse(Console.ReadLine());
  13. int secondInitInput = int.Parse(Console.ReadLine());
  14. int thirdInitInput = int.Parse(Console.ReadLine());
  15. Console.Error.WriteLine(firstInitInput);
  16. Console.Error.WriteLine(secondInitInput);
  17. Console.Error.WriteLine(thirdInitInput);
  18.  
  19. int N_size = 40;
  20.  
  21. char[,] map = new char[N_size,N_size];
  22. for(int x = 0;x<N_size;x++)
  23. {
  24. for(int y = 0;y<N_size;y++)
  25. {
  26. map[x,y]='.';
  27. }
  28. }
  29.  
  30. int currpos_X = N_size/2;
  31. int currpos_Y = N_size/2;
  32. map[currpos_X,currpos_Y]='o';
  33.  
  34. int helper = 0;
  35. while (true)
  36. {
  37. string firstInput = Console.ReadLine();
  38. string secondInput = Console.ReadLine();
  39. string thirdInput = Console.ReadLine();
  40. string fourthInput = Console.ReadLine();
  41.  
  42. Console.Error.WriteLine(firstInput+"\t"+secondInput+"\t"+thirdInput+"\t"+fourthInput);
  43.  
  44. for (int i = 0; i < thirdInitInput; i++)
  45. {
  46. string[] inputs = Console.ReadLine().Split(' ');
  47. int fifthInput = int.Parse(inputs[0]);
  48. int sixthInput = int.Parse(inputs[1]);
  49. Console.Error.WriteLine(fifthInput.ToString()+"\t"+sixthInput.ToString());
  50. }
  51.  
  52. if(fourthInput=="_")
  53. {
  54. currpos_X--;
  55. map[currpos_X,currpos_Y]='o';
  56. Console.WriteLine("E");
  57. }
  58. else if(thirdInput=="_")
  59. {
  60. currpos_Y--;
  61. map[currpos_X,currpos_Y]='o';
  62. Console.WriteLine("D");
  63. }
  64. else if(firstInput=="_")
  65. {
  66. currpos_Y++;
  67. map[currpos_X,currpos_Y]='o';
  68. Console.WriteLine("C");
  69. }
  70. else if(secondInput=="_")
  71. {
  72. currpos_X++;
  73. map[currpos_X,currpos_Y]='o';
  74. Console.WriteLine("A");
  75. }
  76.  
  77. for(int y =0;y<N_size;y++)
  78. {
  79. string linestring = "";
  80. for(int x =0;x<N_size;x++)
  81. {
  82. linestring = linestring+map[x,y];
  83. }
  84. Console.Error.WriteLine(linestring);
  85. }
  86. }
  87. }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement