RosettaCodeData/Task/Amb/Julia/amb-2.jl
2024-10-16 18:07:41 -07:00

2 lines
257 B
Julia

iter = Iterators.product(["the", "that", "a"], ["frog", "elephant", "thing"], ["walked", "treaded", "grows"], ["slowly", "quickly"])
@show [join(c, " ") for c in iter if all(i -> c[i][end] == c[i + 1][begin], 1:length(c)-1)] # ["that thing grows slowly"]