Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write at specified location (Console) [duplicate]

Tags:

c#

console

I am trying to create points inside a console window based on a 80x49 grid. But I am getting stuck on the basic idea.

My thought was to first of all print out spaces on the entire page so that later, when my method Draw() is called, it replaces a space with a character of choosing.

Keep in mind that the application should be able to print out new points on the same "canvas" again and again. Say that we first print a * at 4,5 and then a * at 4,7 . I am guessing SetCursorPos wouldn't work?

like image 770
Mattias Avatar asked Aug 04 '26 17:08

Mattias


1 Answers

Yes, Console.SetCursorPosition is what you should use.

like image 130
alexn Avatar answered Aug 07 '26 07:08

alexn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!