Non-continuous subsequences: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added/changed whitespace and comments, elided the STYLE from the PRE html tags.)
m (→‎{{header|Sidef}}: minor code simplifications)
Line 1,940: Line 1,940:
=={{header|Sidef}}==
=={{header|Sidef}}==
{{trans|Perl}}
{{trans|Perl}}
<lang ruby>func non_continuous(min, max, subseq, has_gap=false) {
<lang ruby>func non_continuous(min, max, subseq=[], has_gap=false) {


subseq \\= [];
static current = [];
static current = [];


Line 1,950: Line 1,949:
i < max && non_continuous(i.inc, max, subseq, has_gap);
i < max && non_continuous(i.inc, max, subseq, has_gap);
current.pop;
current.pop;
has_gap = current.len?;
has_gap = current.len;
}
}