"Clear" terminal without losing data

I am creating a simulator that outputs the board each time a unit is moved. Cin.ignore(256, '\n'); is used to allow the user to watch the simulation at their own pace. I would like to shift the terminal view down when a new board is output so that only the most recent board is visible, but still keep all the previous output so that the user has the option to scroll up and view previous moves.

Currently I am using the clear function recommended by Duoas in a different thread: http://www.cplusplus.com/forum/articles/10515/#msg49080
This achieves the positioning that I want for the information about a move, but it also gets rid of all previous moves, so you can't scroll up to look at old stuff.

If I use Putty to vpn into my old school's Linux machines I can simply use the form feed character '\f' in place of the ClearScreen() function to achieve the formatting desired without losing all the previous moves. However at work when I debug with Visual Studio 2013, or run it with Windows PowerShell I just get
. Is there a way to get PowerShell to only show one board at a time while still being able to go back and view previous states if desired? I have tried simply putting in excessive '\n' but you see the movement as each one is output. Ideally there is little to no flicker so you can see the characters moving around the board.

Thanks
Last edited on
Topic archived. No new replies allowed.