Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Floyds-triangle/Q/floyds-triangle.q
Normal file
12
Task/Floyds-triangle/Q/floyds-triangle.q
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
floyd:{n:1+ til sum 1+til x;
|
||||
t:d:0;
|
||||
while[1+x-:1;0N!(t+:1)#(d+:t)_n]}
|
||||
|
||||
floyd2:{n:1+ til sum 1+til x;
|
||||
t:d:0;
|
||||
while[1+x-:1;1 (" " sv string each (t+:1)#(d+:t)_n),"\n"]}
|
||||
|
||||
//The latter function 'floyd2' includes logic to remove the leading "," before "1" in the first row.
|
||||
|
||||
floyd[5]
|
||||
floyd2[14]
|
||||
Loading…
Add table
Add a link
Reference in a new issue