-1

Im making a game kind of like HOI4 and ive come to this problem of not knowing how to check bodered territories my first thought was to set the console's cursor position and then check around that to see if they border or not so i searched for ways to check the character that the cursor's is sitting on but none of the solutions ive found works

  • Maybe if you [edit your question](https://stackoverflow.com/posts/68312692/edit) and add any of those attempts you say you tried (and saying why they didnt work) it will be easier to get answers that fix your problem. – Cleptus Jul 09 '21 at 08:02

1 Answers1

0

Use the following code to find the position of the cursor

int left = Console.CursorLeft;
int top = Console.CursorTop;

Use the following code to place the cursor in a specific position

 Console.CursorLeft = 10;
 Console.CursorTop = 15;

or

Console.SetCursorPosition(10, 15);

I do not think it is possible to read the output in a particular situation see here

Meysam Asadi
  • 6,438
  • 3
  • 7
  • 17
  • I think OP want to know what was written in the Console at an specific position. You answer addresses the first part (getting to that position) but IMHO does not take on the relevant part (knowing what was written in that position) – Cleptus Jul 09 '21 at 08:01
  • I do not think it is possible to read the output in a particular situation. – Meysam Asadi Jul 09 '21 at 08:54
  • Indeed, if what OP want to do is what I think he/se does, it is very likely impossible – Cleptus Jul 09 '21 at 08:57