I found that for swi-prolog it exists findnsols, however, it is not working for me.
My predicate generate_color(Color)
generates random colors for html.
When I try to call it N times and save the values of the executions in a list I always get a single result instead of many.
findnsols(3, Color, generate_color(Color),Colors).
Colors = ["# 4c4b43"].
findnsols(3, Color, generate_color(Color),Colors).
Colors = ["# 158955"].
findnsols (300, Color, generate_color (Color), Colors).
Colors = ["# 5d67e1"].
Does anyone know of any way that I can get even the Nsolutions I want in a list?
Expected output:
findnsols(3, Color, generate_color(Color),Colors).
Colors = ["# 5d67e1", "# 4c4b43", "# 158955"].