update meta data

This commit is contained in:
Ingy döt Net 2013-04-11 12:07:39 -07:00
parent f3a896c724
commit 90e15ed6ce
3307 changed files with 1674 additions and 7 deletions

View file

@ -0,0 +1,21 @@
The TPK algorithm is an early example of programming chrestomathy. It was used in Donald Knuth and Luis Trabb Pardo's Stanford tech report [http://bitsavers.org/pdf/stanford/cs_techReports/STAN-CS-76-562_EarlyDevelPgmgLang_Aug76.pdf The Early Development of Programming Languages]. The report traces the early history of work in developing computer languages in the 1940s and 1950s, giving several translations of the algorithm.
From the [[wp:Trabb PardoKnuth algorithm|wikipedia entry]]:
'''ask''' for 11 numbers to be read into a sequence ''S''
'''reverse''' sequence ''S''
'''for each''' ''item'' '''in''' sequence ''S''
''result'' ''':=''' '''call''' a function to do an ''operation''
'''if''' ''result'' overflows
'''alert''' user
'''else'''
'''print''' ''result''
The task is to implement the algorithm:
# Use the function <math>f(x) = |x|^{0.5} + 5x^3</math>
# The overflow condition is an answer of greater than 400.
# The 'user alert' should not stop processing of other items of the sequence.
# Print a prompt before accepting '''eleven''', textual, numeric inputs.
# You may optionally print the item as well as its associated result, but the results must be in reverse order of input.
# The sequence S may be 'implied' and so not shown explicitly.
# ''Print and show the program in action from a typical run here''. (If the output is graphical rather than text then either add a screendump or describe textually what is displayed).