TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Lindenmayer System in Clojure

41 点作者 budu超过 15 年前

3 条评论

rabidgnat超过 15 年前
The best thing about this program is that it shows the power of Clojure's Java interop. Doing graphics programming in other languages often feels like a dirty hack, but this isn't so bad. This might lead me back to try Clojure again<p>Aside: A few months ago I decided to reproduce a program a friend of mine wrote, which was to draw Koch's Snowflake without using recursion. By the end of the day, this morphed into a throwaway Lindenmayer system viewer in C++ with OpenGL. Basically it just lets you toggle the number of iterations and switch between 13 different fractals. The Clojure code is a lot nicer than the C++ that I banged out, which probably goes without saying! I was trying to add 20, but they were a pain to derive and I didn't want to work on it for more than a day<p><a href="http://github.com/jakevoytko/fractals" rel="nofollow">http://github.com/jakevoytko/fractals</a>
zck超过 15 年前
Interesting; this article says the rewrite rule is <i>F -&#62; F+F-F-F+F</i> , but Wikipedia says <i>F → F−F++F−F</i> . I think Wikipedia's is right, as (for a beginning) there are only four line segments in step N+1 for each line segment in step N. Take out the F between the minus signs in this article's rule, and it would be correct ( <i>F -&#62; F+F--F+F</i> ), allowing for mirroring of the Wikipedia formula.
评论 #1081745 未加载
albertcardona超过 15 年前
Don't miss the graphics at the bottom.