i need to print stars '*' n amount of time
相关问题
- 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
Very simple solution:
One of the problem in your code is that if you call
star
withN-1
, at the next iterationN
will be unified withN-1
(as you write it, it does not performs the arithmetic operation). Instead you should doN1 is N-1
and then call star withN-1
. Then there are other problems... Look at my code to have an idea.