本文介绍了我听说 LaTeX 是图灵完备的.有没有用 LaTeX 编写的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以用通常被认为是排版语言的东西来做有趣的事情.例如,您可以使用 postscript 构造 Mandelbrot 集.

It's possible to do interesting things with what would ordinarily be thought of as typesetting languages. For example, you can construct the Mandelbrot set using postscript.

这个 MathOverflow 问题中建议 LaTeX 可能是 图灵完备.这意味着编写任意程序的能力(尽管这可能并不容易!).有谁知道 LaTeX 中此类程序的任何具体示例,它对语言做了一些非常不寻常的事情?

It is suggested in this MathOverflow question that LaTeX may be Turing-complete. This implies the ability to write arbitrary programs (although it may not be easy!). Does anyone know of any concrete example of such a program in LaTeX, which does something highly unusual with the language?

推荐答案

Monad Reader,Stephen Hicks 写了关于在 TeX 中实现 ICFP 竞赛(涉及火星探测器导航)的解决方案,并大量使用宏.有趣的是,排版时解决方案的输出是漫游者路径的附记地图.

In issue 13 of The Monad Reader, Stephen Hicks writes about implementing the solution to an ICFP contest (involving Mars rover navigation) in TeX, with copious use of macros. Amusingly, the solution's output when typeset is a postscript map of the rover's path.

这篇关于我听说 LaTeX 是图灵完备的.有没有用 LaTeX 编写的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 02:07