Power set: Difference between revisions
Content added Content deleted
Walterpachl (talk | contribs) (added PL/I translated from REXX) |
Walterpachl (talk | contribs) m (→{{header|PL/I}}: post correct version) |
||
Line 1,639: | Line 1,639: | ||
a(y)=a(y)+1; |
a(y)=a(y)+1; |
||
If a(y)=base Then |
If a(y)=base Then |
||
If |
If combu(ym) Then |
||
Leave; |
Leave; |
||
End; |
End; |
||
/* Put Edit('combn',y,z)(Skip,a,f(2),x(1),a); */ |
/* Put Edit('combn',y,z)(Skip,a,f(2),x(1),a); */ |
||
Return(z); |
Return(z); |
||
combu: Proc(d) Recursive Returns(Bin Fixed(31)); |
|||
Dcl (d,u) Bin Fixed(31); |
|||
If d=0 Then |
|||
Return(1); |
|||
p=a(d); |
|||
Do u=d To y; |
|||
a(u)=p+1; |
|||
If a(u)=bbase+u Then |
|||
Return(combu(u-1)); |
|||
p=a(u); |
|||
End; |
|||
Return(0); |
|||
End; |
|||
End; |
End; |
||