Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:between [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== Between ======
 +{{tag>​arithmetic}}
 +===== Description =====
 +K is an integer between the integers I and J inclusive in predicat mybetween(I,​J,​K).
 +
 +**Source**: ​ The Art of Prolog
 +===== Download =====
 +Program source code: {{between.pl}}
 +===== Listing =====
 +<code prolog>
 +/​*  ​
 +  mybetween(I,​J,​K) :- K is an integer between the integers I and J inclusive.
 +*/
 +     ​mybetween(I,​J,​I) :- I =< J.
 +     ​mybetween(I,​J,​K) :- I < J, I1 is I + 1, mybetween(I1,​J,​K).
 +
 +%  Program 8.5   ​Generating a range of integers
 +
 +</​code>​
 +===== Comments =====
  
pl/prolog/pllib/between.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0