3

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?

peterh
  • 11,875
  • 18
  • 85
  • 108
Mattias
  • 41
  • 1
  • 1
  • 3
  • why shouldn't SetCursorPos work? – user492238 Apr 05 '11 at 06:36
  • Since that will only place the cursor in the grid and then adding, right? That would push away the points thats been put there prior to this. Or am I not really getting the method? – Mattias Apr 05 '11 at 06:50

2 Answers2

4

Yes, Console.SetCursorPosition is what you should use.

alexn
  • 57,867
  • 14
  • 111
  • 145
2

see advanced console io in .net

Community
  • 1
  • 1
thumbmunkeys
  • 20,606
  • 8
  • 62
  • 110