RosettaCodeData/Task/Balanced-brackets/Picat/balanced-brackets-2.picat
2023-07-01 13:44:08 -04:00

15 lines
259 B
Text

go_dcg ?=>
tests(Tests),
foreach(Test in Tests)
printf("%s: ", Test),
if balanced(Test,[]) then
println("OK")
else
println("NOT OK")
end
end,
nl.
go_dcg => true.
balanced --> "".
balanced --> "[", balanced, "]", balanced.