TPK algorithm: Difference between revisions

Content deleted Content added
python golf
SmackBot (talk | contribs)
m ISBN formatting &/or general fixes using AWB
Line 1:
The '''Trabb Pardo-Knuth algorithm''' is a [[computer program|program]] introduced by [[Donald Knuth]] and [[Luis Trabb Pardo]] to illustrate the evolution of computer [[programming language]]s.
 
In their [[1980]] work "The Early Development of Programming Languages", Trabb Pardo and Knuth introduced a trivial program which involved [[array]]s, [[index_index (information_technologyinformation technology)|indexing]], mathematical [[Function (mathematics)|function]]s, [[subroutine]]s, [[I/O]], [[conditional]]s and [[iteration]]. They then wrote implementations of the algorithm in several early programming languages to show how such concepts were expressed.
 
The simpler [[Hello world program]] has been used for much the same purpose.
Line 30:
<pre>
print map$_.$/,reverse map"@$_",
map[$$_[0],$$_[1]>400?'TOO LARGE':$$_[[1]],
map[$$_[0],sub{5*$_[0]**3+sqrt abs$_[0]}->($$_[1])],
map[$_+0,$_=<>],0..10
Line 50:
 
==References==
* "The Early Development of Programming Languages" in ''A History of Computing in the Twentieth Century'', New York, Academic Press, 1980. ISBN 01249165030-12-491650-3 (Reprinted in Knuth, Donald E., ''et al'', ''Selected Papers on Computer Languages'', Stanford, CA, CSLI, 2003. ISBN 15758638201-57586-382-0)
 
==External link==