Jump to content

Amb: Difference between revisions

No change in size ,  5 years ago
m
m (→‎version 1: optimized AMB function, changed whitespace.)
Line 63:
 
// Traverse into the tree.
AV res = amb(comp, options[1..], opt)
 
// If it was a failure, try the next one.
Line 71:
R []
 
AV sets = [[‘the’, ‘that’, ‘a’],
[‘frog’, ‘elephant’, ‘thing’],
[‘walked’, ‘treaded’, ‘grows’],
[‘slowly’, ‘quickly’]]
 
AV result = amb((s, t) -> s.last == t[0], sets)
print(result.join(‘ ’))</lang>
{{out}}
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.