Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Pascals-triangle/Red/pascals-triangle.red
Normal file
14
Task/Pascals-triangle/Red/pascals-triangle.red
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Red[]
|
||||
pascal-triangle: function [
|
||||
n [ integer! ] "number of rows"
|
||||
][
|
||||
row: make vector! [ 1 ]
|
||||
loop n [
|
||||
print row
|
||||
left: copy row
|
||||
right: copy row
|
||||
insert left 0
|
||||
append right 0
|
||||
row: left + right
|
||||
]
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue