Knuth's power tree: Difference between revisions

m
J: decorate inline code
m (J: make implementation of kpt more closely match 'inductive' pattern)
m (J: decorate inline code)
Line 80:
This task is a bit verbose...
 
We can represent the tree as a list of indices. Each entry in the list gives the value of <code>n</code> for the index <code>a+n</code>. (We can find <code>a</code> using subtraction.)
 
<lang J>kpt=:3 :0
6,962

edits