Ruby 和控制台输出

发布于 2024-08-19 00:37:10 字数 209 浏览 2 评论 0原文

通常,可以通过 Ruby 库在公共 Windows 控制台屏幕上的特定位置输出符号,该位置似乎是 80x25 ?

问题是需要绘制一个特定的“树”结构,如下所示:

│
├──x──y──z
│        │
│        ├──a──b──c
│        │
│        └──e──f──g
│
└──u──v──o

It is possible, generally, by means of Ruby library to output a symbol at specific location on a common Windows console screen, which seems to be 80x25 ?

The problem came up with the need to draw a specific 'tree' structure like this, for example:

│
├──x──y──z
│        │
│        ├──a──b──c
│        │
│        └──e──f──g
│
└──u──v──o

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

蓝天白云 2024-08-26 00:37:10

如果您只是对在控制台中生成树感兴趣,这篇文章向您展示了如何使用 hirb 来做到这一点。

If you're just interested generating trees in the console, this post shows you how to do it with hirb.

过期情话 2024-08-26 00:37:10

您可以使用 Curses 的包装器,例如 one

You could use a wrapper for Curses, like this one.

可爱暴击 2024-08-26 00:37:10

Win32Console 项目应该可以满足您的需求,甚至更多。另外,你的问题让我有点想起Ruby Quiz #14 (LCD Numbers)

The Win32Console project should do what you want, and much more. Also, your question reminds me slightly of Ruby Quiz #14 (LCD Numbers).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文