# Improving Wang's algorithm in Prolog

**URL:** <https://swi-prolog.discourse.group/t/improving-wangs-algorithm-in-prolog/2872>\
**Category:** Algorithm\
**Tags:** how-to\
**Created:** [September 4, 2020, 1:15pm UTC](https://swi-prolog.discourse.group/t/improving-wangs-algorithm-in-prolog/2872 "2020-09-04T13:15:20Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [September 4, 2020, 3:51pm UTC](https://swi-prolog.discourse.group/t/improving-wangs-algorithm-in-prolog/2872/4 "2020-09-04T15:51:29Z")

</div>

> [@joseph-vidal-rosset](#):
>
> I did not understand how works [format/2](https://www.swi-prolog.org/pldoc/doc_for?object=format/2),3 and I must say frankly that the official documentation of [SWI-Prolog](https://www.swi-prolog.org/pldoc/doc_for?object=manual) lacks of clear and simple examples for people who try to learn Prolog: predicates are formally described, but some lines of code in some short programs would be helpful and often there is no the least example to get the use of such or such predicate. That is very frustrating.

Just ask, we don’t bite.

Many of us understand what you are saying ([ref](https://swi-prolog.discourse.group/t/crowd-contributing-a-prolog-cookbook-an-embryonic-kernel/2307)) and it does take time to learn how to read the documentation.

Now for the hard part, if you start to learn how to use the predicates such as format/2,3 that you don’t know how to currently use, then you should add example comments on the documentation [pages](https://www.swi-prolog.org/pldoc/man?predicate=format/2), add to post here in categories such as [Nice to know](https://swi-prolog.discourse.group/c/nice-to-know/17), [Useful Code](https://swi-prolog.discourse.group/c/useful-code/16), [Wiki](https://swi-prolog.discourse.group/c/wiki/12), create SWISH [tutorial](https://swish.swi-prolog.org/example/prolog_tutorials.swinb), create GitHub [gist](https://gist.github.com/), create GitHub [repositories](https://github.com/), add to [Useful Prolog References](https://swi-prolog.discourse.group/t/useful-prolog-references/1089), etc.

> [@joseph-vidal-rosset](#):
>
> I know no documentation to learn it.

Have you ever heard the quote about being a master of something.

> A master has done it more ways wrong than a beginner has done it.

I can assure you I have done Cytoscape.js more ways wrong in the last several days than I have done it right, but I did just added a [post](https://swi-prolog.discourse.group/t/wiki-discussion-generating-cytoscape-js-graphs-with-swi-prolog/2816/4) in preparation for the Wiki.

While you may not see it, you are not alone in a crowed boat, the difference is you are at least asking questions and trying to learn, I can’t tell you how many times I hear from others that they started to learn Prolog and then gave up but wish they had the will-power to stay with it. 🙂

Think about where you were when you asked the question at StackOverflow and where you are now.

---

_[View the full topic](https://swi-prolog.discourse.group/t/improving-wangs-algorithm-in-prolog/2872)._
