I have to write a DCG that generates strings from the alphabet a E {0,1,2} the strings have to have the form nn. This means queries like ?- s([0,2,1,0,2,1],[]). and s([1,1,2,0,1,1,2,0],[]). would return true.
This is the code I have so far. I'm so close. Can someone help me further?
s -->...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.