RosettaCodeData/Task/Balanced-brackets/Picat/balanced-brackets-2.picat

16 lines
259 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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.