15 lines
408 B
Text
15 lines
408 B
Text
val .wordsets = [
|
|
fw/the that a/,
|
|
fw/frog elephant thing/,
|
|
fw/walked treaded grows/,
|
|
fw/slowly quickly/,
|
|
]
|
|
|
|
val .alljoin = fn(.words) for[=true] .i of len(.words)-1 {
|
|
if last(.words[.i]) != first(.words[.i+1]): break = false
|
|
}
|
|
|
|
# .amb expects 2 or more arguments
|
|
val .amb = fn(...[2 .. -1] .words) if(.alljoin(.words): join " ", .words)
|
|
|
|
writeln join "\n", filter mapX .amb, .wordsets...
|