如何使用 T-SQL 生成 Mandelbrot?
学习了一些关于 T-SQL 的知识,并认为一个有趣的练习是用它生成 Mandelbrot 集。
事实证明已经有人拥有了(而且最近出现了)。 我会让其他人将其作为答案发布,但我很好奇可以进行哪些优化。
或者,您会采取什么措施使代码更具可读性?
我将选择最具可读性(但相当紧凑)的版本作为接受的答案(太糟糕了,我们还没有代表赏金!),除非有人确实进行了出色的优化。
奖励点是那些教我一些关于 T-SQL 的答案。
-亚当
Learning a little about T-SQL, and thought an interesting exercise would be to generate a Mandelbrot set with it.
Turns out someone already has (and recently, it appears). I'll let someone else post it as an answer, but I'm curious what optimizations can be made.
Alternately, what would you do to make the code more readable?
I'll select the most readable (yet reasonably compact) version as the accepted answer (too bad we don't have rep bounties yet!) unless someone really comes along with a great optimization.
Bonus points to those answers that teach me a little something about T-SQL.
-Adam
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
来自 thedailywtf.com
(来源:thedailywtf.com)
From thedailywtf.com
(source: thedailywtf.com)
希望这也能教会一些有关 T-SQL 的知识,它以基于集合的方法完成所有操作,这是 TSQL 的优势(即没有 while 循环)或变量:
Hopefully, this teaches a bit about T-SQL as well, It does everything in a set based approach which is TSQL's strength (i.e. no while loops) or variables: