Range extraction: Difference between revisions

→‎{{header|Tailspin}}: update syntax and correct algorithm
(→‎{{header|Tailspin}}: update syntax and correct algorithm)
Line 4,934:
templates extract
templates out
when <{start: <=$.end>}> do '$.start;' !
when <{startend: <=$.endstart+1>}> do '$.start;,$.end;' !
<>otherwise '$.start;-$.end;' !
end out
@: {start: $(1), end: $(1)};
[ $(2..-1last)... -> #, $@ -> out ] -> '$...;' !
when <=$@.end+1> do @.end: $;
<>otherwise $@ -> out !
',' !
@: {start: $, end: $};
Line 4,953:
{{out}}
<pre>
0-2,4,6-8,11-,12,14-25,27-33,35-39
</pre>
 
Anonymous user