So I'm coding a chat Bot and I need to keep taking input from the user as long as they don't type 'quit.', but if they do I must do a certain recap of what the user asked and then return true , I'm having trouble with the predicate that will keep reading the input till quit is typed , Can anyone help me? Thanks
相关问题
- Creating a SPARQL parameterized query using append
- How to join rules and print out outputs in prolog
- Splitting list and iterating in prolog
- Accumulating while in recursion/backtracking
- prolog trace how to use
相关文章
- What are the problems associated to Best First Sea
- How can I fix this circular predicate in Prolog?
- How to negate in Prolog
- Remove incorrect subsequent solutions without once
- prolog two lists are exactly the same
- Simplify Expressions in Prolog
- Check if any element's frequency is above a li
- Prolog — symetrical predicates
The question is worded rather generally, so here's a description of how to make it work in Prolog semi-pseudo-code:
The way the
repeat-fail
loop works is that you want to fail to continue to do your loop. Then for exiting the loop, you want to succeed with a cut.