问题
I am currently writing a C++ program which must be able to show a rotating cube in a terminal. (school assignment). So I start off with a 60*60 array (two-dimensional vector, to be exact) of chars, which I am going to write to the screen. But if I just do this with two for-loops and std::cout
I get very ugly output: just the screen under the previous one, endlessly.
So I need something better, I need to do something like what Vim does: it seems to take over the console, and when you are done it dissapears, and you terminal is back. How can I do this?
回答1:
You can use a library like ncurses to do this.
来源:https://stackoverflow.com/questions/15459466/how-to-get-full-control-over-the-console