Size: 630
Comment:
|
← Revision 10 as of 2008-08-20 18:57:18 ⇥
Size: 638
Comment: converted to 1.6 markup
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## page was renamed from Puzzles/PascalsTriangle | |
Line 17: | Line 16: |
Write an APL function that takes argument and return a triangle like the one shown above. The argument defines the number of layers. The shown example has 6 layers, for example. | Write an APL function that takes an argument and returns a triangle like the one shown above. The argument defines the number of layers. The shown example has 6 layers. |
Line 19: | Line 18: |
In APL, of course this can be done in a single line of APL. | It is not a problem to produce the numbers - it is a formatting task. |
Line 21: | Line 20: |
>> [:PascalsTriangle/Solution:A solution] | Of course this can be done in a single line of APL. >> [[PascalsTriangle/Solution|The Solution]] |
Line 23: | Line 24: |
CategoryPuzzle | CategoryPuzzles |
Pascal's triangle
In mathematics, Pascal's triangle is a geometric arrangement of the binomial coefficients in a triangle.
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1
The task
Write an APL function that takes an argument and returns a triangle like the one shown above. The argument defines the number of layers. The shown example has 6 layers.
It is not a problem to produce the numbers - it is a formatting task.
Of course this can be done in a single line of APL.
>> The Solution