|
|
Line 3,520: |
Line 3,520: |
|
1 5 10 10 5 1 |
|
1 5 10 10 5 1 |
|
</pre> |
|
</pre> |
|
|
|
|
|
|
|
⚫ |
=={{header|Vedit macro language}}== |
|
⚫ |
===Summing from Previous Rows=== |
|
⚫ |
|
|
|
|
|
⚫ |
Vedit macro language does not have actual arrays (edit buffers are normally used for storing larger amounts of data). |
|
⚫ |
However, a numeric register can be used as index to access another numeric register. |
|
⚫ |
For example, if #99 contains value 2, then #@99 accesses contents of numeric register #2. |
|
|
|
|
⚫ |
<lang vedit>#100 = Get_Num("Number of rows: ", STATLINE) |
|
⚫ |
|
|
⚫ |
Ins_Char(' ', COUNT, #100*3-2) Num_Ins(1) |
|
⚫ |
for (#99 = 2; #99 <= #100; #99++) { |
|
⚫ |
Ins_Char(' ', COUNT, (#100-#99)*3) |
|
⚫ |
|
|
⚫ |
for (#98 = #99; #98 > 0; #98--) { |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
|
|
|
⚫ |
===Using binary coefficients=== |
|
⚫ |
|
|
⚫ |
<lang vedit>#1 = Get_Num("Number of rows: ", STATLINE) |
|
⚫ |
for (#2 = 0; #2 < #1; #2++) { |
|
⚫ |
|
|
⚫ |
Ins_Char(' ', COUNT, (#1-#2-1)*3) |
|
⚫ |
for (#4 = 0; #4 <= #2; #4++) { |
|
⚫ |
|
|
⚫ |
#3 = #3 * (#2-#4) / (#4+1) |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
|
|
|
|
|
|
|
=={{header|Visual Basic}}== |
|
=={{header|Visual Basic}}== |
Line 3,559: |
Line 3,596: |
|
</pre> |
|
</pre> |
|
|
|
|
|
|
|
⚫ |
=={{header|Vedit macro language}}== |
|
⚫ |
===Summing from Previous Rows=== |
|
⚫ |
|
|
|
|
|
⚫ |
Vedit macro language does not have actual arrays (edit buffers are normally used for storing larger amounts of data). |
|
⚫ |
However, a numeric register can be used as index to access another numeric register. |
|
⚫ |
For example, if #99 contains value 2, then #@99 accesses contents of numeric register #2. |
|
|
|
|
⚫ |
<lang vedit>#100 = Get_Num("Number of rows: ", STATLINE) |
|
⚫ |
|
|
⚫ |
Ins_Char(' ', COUNT, #100*3-2) Num_Ins(1) |
|
⚫ |
for (#99 = 2; #99 <= #100; #99++) { |
|
⚫ |
Ins_Char(' ', COUNT, (#100-#99)*3) |
|
⚫ |
|
|
⚫ |
for (#98 = #99; #98 > 0; #98--) { |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
|
|
|
⚫ |
===Using binary coefficients=== |
|
⚫ |
|
|
⚫ |
<lang vedit>#1 = Get_Num("Number of rows: ", STATLINE) |
|
⚫ |
for (#2 = 0; #2 < #1; #2++) { |
|
⚫ |
|
|
⚫ |
Ins_Char(' ', COUNT, (#1-#2-1)*3) |
|
⚫ |
for (#4 = 0; #4 <= #2; #4++) { |
|
⚫ |
|
|
⚫ |
#3 = #3 * (#2-#4) / (#4+1) |
|
⚫ |
|
|
⚫ |
|
|
⚫ |
|
|
|
|
|
|
|
=={{header|XPL0}}== |
|
=={{header|XPL0}}== |