2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -0,0 +1,15 @@
function ExpandRanges(ranges : String) : array of Integer;
begin
for var range in ranges.Split(',') do begin
var separator = range.IndexOf('-', 2);
if separator > 0 then begin
for var i := range.Left(separator-1).ToInteger to range.Copy(separator+1).ToInteger do
Result.Add(i);
end else begin
Result.Add(range.ToInteger)
end;
end;
end;
var expanded := ExpandRanges('-6,-3--1,3-5,7-11,14,15,17-20');
PrintLn(JSON.Stringify(expanded));