Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -0,0 +1,30 @@
$ include "seed7_05.s7i";
const func array bitset: ncsub (in bitset: seq, in integer: s) is func
result
var array bitset: subseq is 0 times {};
local
var bitset: x is {};
var bitset: xs is {};
var bitset: ys is {};
begin
if seq <> {} then
x := {min(seq)};
xs := seq - x;
for ys range ncsub(xs, s + 1 - s rem 2) do
subseq &:= x | ys;
end for;
subseq &:= ncsub(xs, s + s rem 2);
elsif s >= 3 then
subseq &:= {};
end if;
end func;
const proc: main is func
local
var bitset: seq is {};
begin
for seq range ncsub({1, 2, 3, 4}, 0) do
writeln(seq);
end for;
end func;