RosettaCodeData/Task/Amb/FutureBasic/amb.basic

27 lines
712 B
Plaintext

CFStringRef local fn Amb( a1 as CFArrayRef, a2 as CFArrayRef, a3 as CFArrayRef, a4 as CFArrayRef )
for CFStringRef s1 in a1
for CFStringRef s2 in a2
for CFStringRef s3 in a3
for CFStringRef s4 in a4
if ( ucc(s1,len(s1)-1) == ucc(s2) && ucc(s2,len(s2)-1) == ucc(s3) && ucc(s3,len(s3)-1) == ucc(s4) )
return concat @" ",(s1,s2,s3,s4)
end if
next
next
next
next
end fn = @""
void local fn DoIt
CFArrayRef a1 = @[@"the",@"that",@"a"]
CFArrayRef a2 = @[@"frog",@"elephant",@"thing"]
CFArrayRef a3 = @[@"walked",@"treaded",@"grows"]
CFArrayRef a4 = @[@"slowly",@"quickly"]
print fn Amb( a1, a2, a3, a4 )
end fn
fn DoIt
HandleEvents