方案:将代码转换为图片
我有一个奇怪的计划问题。这是我正在帮助朋友做的更大事情的一部分。
我需要将 Tree:Data
转换为准确表示树的图像(很抱歉,我还没有可以显示的示例图像)。
如果您对此有任何想法(和/或有疑问),请告诉我,以便我可以更新更多信息。
谢谢
I have a weird Scheme question. This is a part of something bigger that I'm helping a friend with.
I need to convert a Tree:Data
into an image that accurately represents the tree (I'm sorry I don't have a sample image to show just yet).
Please let me know if you have any ideas for this (and/or if you have questions) so I can update with more information.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
绘制此类图表的最常见方法之一是使用 graphviz。您只需要扫描树并以非常简单的语法打印出连接。
One of the most common ways to draw such diagrams is using graphviz. You just need to scan the tree and print out the connections in a very simple syntax.
如果你真的、真的、真的必须直接在Scheme中完成它,那么让我在这里指导你:
http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Drawing-Graphics.html
方案确实有一个内置的图形库,尽管这可能只是 MIT 方案所特有的。在伯克利,我们的入门课使用了 SICP,并且我们确实有图形,尽管这些图形是否是内置的,或者教师是否为我们添加了它们,我不太清楚。
If you really, really, really have to do it directly within Scheme, then let me direct you here:
http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/Drawing-Graphics.html
Scheme does indeed have a built-in graphics library, although this may be peculiar only to MIT Scheme. At Berkeley, our intro class used SICP, and we did have graphics somehow, although whether or not these graphics were built-in or whether the instructors added them for us, I'm not too clear on.
这就是我一直在寻找的答案。我想我应该更好地表达我的问题。无论如何,非常感谢@EliBarzilay 和@KevinHwang 的帮助
This is the answer I was looking for. I guess I should have articulated my question a little better. Thank you very much for the help anyways, @EliBarzilay and @KevinHwang