How to prevent automatic newlines, when the output is wider than the console?

心不动则不痛 提交于 2021-01-27 13:12:05

问题


I'm implementing the game of life, using console output. So far it's looking good:

Before

However, when I make the width of the output larger than the with of the console, this happens:

After

Instead of letting the lines run offscreen, it inserts a newline. Is there a way to turn this off?

I'm on a small laptop, so changing the console width doesn't really help.


回答1:


I think you have to get and set the maximum length of the screen.

So you get the length.

If you need more space you can set the windows size :) Dont forget to set the BufferSize too



来源:https://stackoverflow.com/questions/22417627/how-to-prevent-automatic-newlines-when-the-output-is-wider-than-the-console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!