<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.visual-prolog.com/index.php?action=history&amp;feed=atom&amp;title=Tutorial_Project._Release_2</id>
	<title>Tutorial Project. Release 2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.visual-prolog.com/index.php?action=history&amp;feed=atom&amp;title=Tutorial_Project._Release_2"/>
	<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;action=history"/>
	<updated>2026-04-13T04:34:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2564&amp;oldid=prev</id>
		<title>Victor Yukhtenko at 13:35, 1 April 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2564&amp;oldid=prev"/>
		<updated>2011-04-01T13:35:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:35, 1 April 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l28&quot;&gt;Line 28:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;vip&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;vip&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*********************************************************&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*********************************************************&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Copyright (c) Victor Yukhtenko&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpbSolutions/Examples/Polyline&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpbSolutions/Examples/Polyline&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Victor Yukhtenko</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2554&amp;oldid=prev</id>
		<title>Victor Yukhtenko at 13:09, 31 March 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2554&amp;oldid=prev"/>
		<updated>2011-03-31T13:09:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:09, 31 March 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l22&quot;&gt;Line 22:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 22:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|open=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|open=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Polyline1_10Open|project=&amp;#039;&amp;#039;&amp;#039;Examples\Polyline\&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Polyline1&lt;/del&gt;\Polyline2.prj&amp;#039;&amp;#039;&amp;#039;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Polyline1_10Open|project=&amp;#039;&amp;#039;&amp;#039;Examples\Polyline\&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Polyline2&lt;/ins&gt;\Polyline2.prj&amp;#039;&amp;#039;&amp;#039;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Polyline1-06Copy_Paste}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Polyline1-06Copy_Paste}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Victor Yukhtenko</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2531&amp;oldid=prev</id>
		<title>Victor Yukhtenko at 18:55, 26 March 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2531&amp;oldid=prev"/>
		<updated>2011-03-26T18:55:03Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:55, 26 March 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spbCopyright&lt;/del&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;PolylineTemplateEn&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|goal=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Demonstrating the properties of Visual Prolog language and simple programming techniques, including:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|goalContent=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The generating of random numbers;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The Class Interface;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The use of the same interface in different classes;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The use of facts-variables;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The generating a simple exceptions;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The simple exception handling;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The use of constants.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|code=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Compare to [[Tutorial Project. Release 1]]:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** Models of behavior of a human and of a computer built as dynamic classes;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** Predicates explicitly related to the user interface placed to a separate class;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* In this version used field size 6x6 pixels.;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Due to an inefficient algorithm for the computer game field size more than 36 cells (6x6, for example) to install not recommended.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|functionality=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* If the machine makes the first move, it makes it randomly;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* If model has no obvious secure move, then it makes it randomly.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|install={{PolylineInstall&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This program is part of the [[Tutorial Project Evolutions]] article.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|open=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Polyline1_10Open&lt;/ins&gt;|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;project&lt;/ins&gt;=&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#039;&amp;#039;&amp;#039;Examples\Polyline\Polyline1\Polyline2&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;prj&amp;#039;&amp;#039;&amp;#039;&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{PolyLine Game Rules}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;note&lt;/del&gt;|&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;content&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The size of the field is 6x6&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br\&amp;gt;It is not recommended to set the size of the field more than 36 points (say 6 x 6) due to the non efficient algorithm used&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The strategy of the computer behaviour adopted from the  [[Tutorial Project. Release 1]] (written by Elena Efimova).&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Differences (relative to version 1):&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* If the computer makes the first move, then it is done random&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* If computer can not find the successful move, then it is done random (even if it is extremely bad)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The human and computer models are object-generating classes&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Predicates, which relate to the human-machine interaction grouped to class HumanInterface&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To run the game please make the steps as follows: &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*Create the new project with the User Interface strategy Console&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*In the created project replace the entire content of the file &amp;quot;main.pro&amp;quot; by the code shown below&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;*While building the project answer &amp;quot;Add All&amp;quot;, when any dialog with proposals to include any packages to the project appears&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Polyline1-06Copy_Paste}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|run=Run the application using the “E” of the IDE or run the executable at the directory EXE.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;vip&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;vip&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*********************************************************&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*********************************************************&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copyright (c) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;2007-2010 &lt;/del&gt;Victor Yukhtenko&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copyright (c) Victor Yukhtenko&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tested with Vip 7.3 &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpbSolutions/Examples/Polyline&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpbSolutions/Examples/Polyline&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   rule_nd,&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   rule_nd,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;based on solutions proposed by Elena Efimova&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;based on solutions proposed by Elena Efimova&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Written by: Victor Yukhtenko&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*********************************************************/&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*********************************************************/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;goal&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;goal&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l507&quot;&gt;Line 507:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 507:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end implement humanInterface&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;end implement humanInterface&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/vip&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/vip&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=References&lt;/del&gt;=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|rusver&lt;/ins&gt;=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[ru:Учебный Проект. Релиз 2]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[ru:Учебный Проект. Релиз 2]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tutorial Project Evolutions]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Victor Yukhtenko</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2407&amp;oldid=prev</id>
		<title>Victor Yukhtenko at 21:43, 4 June 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2407&amp;oldid=prev"/>
		<updated>2010-06-04T21:43:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:43, 4 June 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l20&quot;&gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Create the new project with the User Interface strategy Console&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Create the new project with the User Interface strategy Console&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*In the created project replace the entire content of the file &amp;quot;main.pro&amp;quot; by the code shown below &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(VIP 7.1 is still there below)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*In the created project replace the entire content of the file &amp;quot;main.pro&amp;quot; by the code shown below&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*While building the project answer &amp;quot;Add All&amp;quot;, when any dialog with proposals to include any packages to the project appears&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*While building the project answer &amp;quot;Add All&amp;quot;, when any dialog with proposals to include any packages to the project appears&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*********************************************************&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*********************************************************&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copyright (c) 2007-2010 Victor Yukhtenko&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copyright (c) 2007-2010 Victor Yukhtenko&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tested with Vip 7.3 &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpbSolutions/Examples/Polyline&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpbSolutions/Examples/Polyline&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Written by: Victor Yukhtenko&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Written by: Victor Yukhtenko&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tested with Vip 7.3                        &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*********************************************************/&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*********************************************************/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;goal&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;goal&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Victor Yukhtenko</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2402&amp;oldid=prev</id>
		<title>Victor Yukhtenko at 21:18, 4 June 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2402&amp;oldid=prev"/>
		<updated>2010-06-04T21:18:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;amp;diff=2402&amp;amp;oldid=2395&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Victor Yukhtenko</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2395&amp;oldid=prev</id>
		<title>Thomas Linder Puls: Reverted edits by AliceVanderwick (Talk); changed back to last version by Victor Yukhtenko</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2395&amp;oldid=prev"/>
		<updated>2010-05-26T22:45:25Z</updated>

		<summary type="html">&lt;p&gt;Reverted edits by &lt;a href=&quot;/index.php?title=Special:Contributions/AliceVanderwick&quot; title=&quot;Special:Contributions/AliceVanderwick&quot;&gt;AliceVanderwick&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:AliceVanderwick&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:AliceVanderwick (page does not exist)&quot;&gt;Talk&lt;/a&gt;); changed back to last version by &lt;a href=&quot;/index.php?title=User:Victor_Yukhtenko&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:Victor Yukhtenko (page does not exist)&quot;&gt;Victor Yukhtenko&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{spbCopyright}}&lt;br /&gt;
&lt;br /&gt;
This program is part of the [[Tutorial Project Evolutions]] article.&lt;br /&gt;
&lt;br /&gt;
{{PolyLine Game Rules}}&lt;br /&gt;
&lt;br /&gt;
{{note|content=&lt;br /&gt;
The size of the field is 6x6.&amp;lt;br\&amp;gt;It is not recommended to set the size of the field more than 36 points (say 6 x 6) due to the non efficient algorithm used&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The strategy of the computer behaviour adopted from the  [[Tutorial Project. Release 1]] (written by Elena Efimova).&lt;br /&gt;
&lt;br /&gt;
Differences (relative to version 1):&lt;br /&gt;
* If the computer makes the first move, then it is done random&lt;br /&gt;
* If computer can not find the successful move, then it is done random (even if it is extremely bad)&lt;br /&gt;
* The human and computer models are object-generating classes&lt;br /&gt;
* Predicates, which relate to the human-machine interaction grouped to class HumanInterface&lt;br /&gt;
&lt;br /&gt;
To run the game please make the steps as follows: &lt;br /&gt;
&lt;br /&gt;
*Create the new project with the User Interface strategy Console&lt;br /&gt;
*In the created project replace the entire content of the file &amp;quot;main.pro&amp;quot; by the code shown below (VIP 7.1 is still there below)&lt;br /&gt;
*While building the project answer &amp;quot;Add All&amp;quot;, when any dialog with proposals to include any packages to the project appears&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
/*********************************************************&lt;br /&gt;
VIP 7.2&lt;br /&gt;
Copyright (c) 2007-2008 Victor Yukhtenko&lt;br /&gt;
&lt;br /&gt;
SpbSolutions/Examples/Polyline&lt;br /&gt;
&lt;br /&gt;
Predicates, which represent the strategy&lt;br /&gt;
  resolveMove,&lt;br /&gt;
  moveCandidate,&lt;br /&gt;
  successfulMove,&lt;br /&gt;
  rule_nd,&lt;br /&gt;
based on solutions proposed by Elena Efimova&lt;br /&gt;
&lt;br /&gt;
Written by: Victor Yukhtenko                        &lt;br /&gt;
*********************************************************/&lt;br /&gt;
goal&lt;br /&gt;
    mainExe::run(main::run).&lt;br /&gt;
 &lt;br /&gt;
implement main&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;PolyLine&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        console::init(),&lt;br /&gt;
        game::run().&lt;br /&gt;
end implement main&lt;br /&gt;
 &lt;br /&gt;
/**************************************&lt;br /&gt;
The Game class manages the playing process&lt;br /&gt;
**************************************/&lt;br /&gt;
class game&lt;br /&gt;
    open core&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    classInfo : core::classInfo.&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    maxRow_C:positive=6.&lt;br /&gt;
    maxColumn_C:positive=6.&lt;br /&gt;
 &lt;br /&gt;
domains&lt;br /&gt;
    cell = c(positive,positive).&lt;br /&gt;
    moveType_D=&lt;br /&gt;
        ordinary_S;&lt;br /&gt;
        winner_S.&lt;br /&gt;
 &lt;br /&gt;
properties&lt;br /&gt;
    polyline_P:cell*.&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    run:().&lt;br /&gt;
    set:(string CellAsString).&lt;br /&gt;
    rule_nd: (cell,cell) nondeterm (i,o) (i,i).&lt;br /&gt;
    ruleLimited_nd:(cell,cell)-&amp;gt;cell nondeterm.&lt;br /&gt;
 &lt;br /&gt;
end class game&lt;br /&gt;
 &lt;br /&gt;
implement game&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;Game&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
 &lt;br /&gt;
class facts&lt;br /&gt;
    human_V:player:=erroneous.&lt;br /&gt;
    computer_V:player:=erroneous.&lt;br /&gt;
    polyline_P:cell*:=[].&lt;br /&gt;
    endOfGame_V:boolean:=false.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        human_V:=human::new(),&lt;br /&gt;
        computer_V:=computer::new(),&lt;br /&gt;
        playerTurn().&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    playerTurn:().&lt;br /&gt;
clauses&lt;br /&gt;
    playerTurn():-&lt;br /&gt;
        PlayerTurnStr=humanInterface::getInput(humanInterface::playerTurn_S),&lt;br /&gt;
        not(PlayerTurnStr=&amp;quot;&amp;quot;),&lt;br /&gt;
        try&lt;br /&gt;
            hasDomain(positive,PlayerTurn),&lt;br /&gt;
            PlayerTurn=toTerm(PlayerTurnStr),&lt;br /&gt;
            if PlayerTurn=2 then&lt;br /&gt;
                Player=human_V,&lt;br /&gt;
                StarterName=&amp;quot;Computer&amp;quot; % because of it is used NextPlayer in the Play predicate&lt;br /&gt;
            else&lt;br /&gt;
                Player=computer_V,&lt;br /&gt;
                StarterName=&amp;quot;Human&amp;quot;&lt;br /&gt;
            end if,&lt;br /&gt;
            humanInterface::showStage(),&lt;br /&gt;
            !,&lt;br /&gt;
            humanInterface::announceStarter(StarterName),&lt;br /&gt;
            play(Player)&lt;br /&gt;
        catch _TraceID1 do&lt;br /&gt;
            humanInterface::announceChoiceError(humanInterface::errorMustBeNumber_S)&lt;br /&gt;
        end try,&lt;br /&gt;
            !,&lt;br /&gt;
            polyline_P:=[],&lt;br /&gt;
            endOfGame_V:=false,&lt;br /&gt;
            playerTurn().&lt;br /&gt;
    playerTurn().&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    play:(player Player).&lt;br /&gt;
clauses&lt;br /&gt;
    play(Player):-&lt;br /&gt;
        endOfGame_V=true,&lt;br /&gt;
        !,&lt;br /&gt;
        if Player=human_V then&lt;br /&gt;
            humanInterface::announceWin(&amp;quot;Human&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
            humanInterface::announceWin(&amp;quot;Computer&amp;quot;)&lt;br /&gt;
        end if.&lt;br /&gt;
    play(Player):-&lt;br /&gt;
        if Player=human_V then&lt;br /&gt;
            NextPlayer=computer_V,&lt;br /&gt;
            Name=&amp;quot;Computer&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            NextPlayer=human_V,&lt;br /&gt;
            Name=&amp;quot;Human&amp;quot;&lt;br /&gt;
        end if,&lt;br /&gt;
        !,&lt;br /&gt;
        humanInterface::announceMovingPlayer(Name),&lt;br /&gt;
        NextPlayer:move(),&lt;br /&gt;
        play(NextPlayer).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    set(InputString):-&lt;br /&gt;
        Cell=toTerm(InputString),&lt;br /&gt;
        handleInput (Cell).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    handleInput:(cell Cell).&lt;br /&gt;
clauses&lt;br /&gt;
    handleInput(Cell):-&lt;br /&gt;
        list::isMember(Cell,polyline_P),&lt;br /&gt;
        try&lt;br /&gt;
            _=makePolyLine(Cell,polyline_P)   % If the Cell is not acceptable,&lt;br /&gt;
                                                            % then exception appears and we ignore it&lt;br /&gt;
                                                            % using fail&lt;br /&gt;
        catch _TraceID do&lt;br /&gt;
            fail&lt;br /&gt;
        end try,&lt;br /&gt;
        !,&lt;br /&gt;
        endOfGame_V:=true,&lt;br /&gt;
        humanInterface::showMove(Cell,winner_S).&lt;br /&gt;
    handleInput (Cell):-&lt;br /&gt;
        polyline_P:=makePolyLine(Cell,polyline_P),&lt;br /&gt;
        !,&lt;br /&gt;
        humanInterface::showMove(Cell,ordinary_S).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    makePolyLine: (cell,cell*)-&amp;gt; cell* multi.&lt;br /&gt;
clauses&lt;br /&gt;
    makePolyLine(c(X,Y),[])=[c(X,Y)]:-&lt;br /&gt;
        X&amp;gt;0,X&amp;lt;=maxColumn_C,&lt;br /&gt;
        Y&amp;gt;0,Y&amp;lt;=maxRow_C,&lt;br /&gt;
        !.&lt;br /&gt;
    makePolyLine(NewCell,[SingleCell])=[NewCell,SingleCell]:-&lt;br /&gt;
        game::rule_nd(SingleCell, NewCell),&lt;br /&gt;
        !.&lt;br /&gt;
    makePolyLine(NewCell,[Left, RestrictingCell | PolyLineTail])=[NewCell, Left, RestrictingCell | PolyLineTail]:-&lt;br /&gt;
        NewCell=ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    makePolyLine(NewCell,PolyLine)=list::reverse([NewCell,Left, RestrictingCell | PolyLineTail]):-&lt;br /&gt;
        [Left, RestrictingCell | PolyLineTail]= list::reverse(PolyLine),&lt;br /&gt;
        NewCell=ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    makePolyLine(NewCell,_PolyLine)= _PolyLine1:-&lt;br /&gt;
        exception::raise(classInfo,wrongMoveException,[namedValue(&amp;quot;data&amp;quot;,string(toString(NewCell)))]).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    wrongMoveException:exception.&lt;br /&gt;
clauses&lt;br /&gt;
    wrongMoveException&lt;br /&gt;
        (&lt;br /&gt;
        classInfo,&lt;br /&gt;
        predicate_Name(),&lt;br /&gt;
        &amp;quot;The point % can not prolong the polyline!&amp;quot;&lt;br /&gt;
        ).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    ruleLimited_nd(Cell,RestrictingCell)=NewCell:-&lt;br /&gt;
        rule_nd(Cell,NewCell),&lt;br /&gt;
            not(NewCell = RestrictingCell).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    rule_nd(c(X, Y), c(X + 1, Y)):- X &amp;lt; maxColumn_C.&lt;br /&gt;
    rule_nd(c(X, Y), c(X, Y + 1)):- Y &amp;lt; maxrow_C.&lt;br /&gt;
    rule_nd(c(X, Y), c(X - 1, Y)):- X &amp;gt; 1.&lt;br /&gt;
    rule_nd(c(X, Y), c(X, Y - 1)):- Y &amp;gt; 1.&lt;br /&gt;
 &lt;br /&gt;
end implement game&lt;br /&gt;
 &lt;br /&gt;
/******************************************&lt;br /&gt;
  Interface Player&lt;br /&gt;
  Player in responce to predicate call move()&lt;br /&gt;
  must  reply by calling set(ResponceMove)&lt;br /&gt;
******************************************/&lt;br /&gt;
interface player&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    move:().&lt;br /&gt;
end interface player&lt;br /&gt;
 &lt;br /&gt;
/********************************&lt;br /&gt;
  The Class Human&lt;br /&gt;
********************************/&lt;br /&gt;
class human:player&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
end class human&lt;br /&gt;
 &lt;br /&gt;
implement human&lt;br /&gt;
open core, exception&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    move():-&lt;br /&gt;
        InputString=humanInterface::getInput(humanInterface::playerMove_S),&lt;br /&gt;
        try&lt;br /&gt;
            game::set(InputString)&lt;br /&gt;
        catch TraceID do&lt;br /&gt;
            handleException(TraceID),&lt;br /&gt;
            fail&lt;br /&gt;
        end try,&lt;br /&gt;
        !.&lt;br /&gt;
    move():-&lt;br /&gt;
        move().&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    handleException:(exception::traceId TraceID).&lt;br /&gt;
clauses&lt;br /&gt;
    handleException(TraceID):-&lt;br /&gt;
        foreach Descriptor=exception::getDescriptor_nd(TraceID) do&lt;br /&gt;
            Descriptor = exception::descriptor(&lt;br /&gt;
                _ClassInfo1,&lt;br /&gt;
                exception::exceptionDescriptor(_ClassInfo2,_PredicateName,Description),&lt;br /&gt;
                _Kind,&lt;br /&gt;
                ExtraInfo,&lt;br /&gt;
                _GMTTime,&lt;br /&gt;
                _ExceptionDescription,&lt;br /&gt;
                _ThreadId),&lt;br /&gt;
            if&lt;br /&gt;
                ExtraInfo=[namedValue(&amp;quot;data&amp;quot;,string(CellPointer))]&lt;br /&gt;
            then&lt;br /&gt;
                ErrorMsg=string::format(Description,CellPointer),&lt;br /&gt;
                humanInterface::announceError(ErrorMsg)&lt;br /&gt;
            else&lt;br /&gt;
                humanInterface::announceError(&amp;quot;&amp;quot;)&lt;br /&gt;
            end if&lt;br /&gt;
        end foreach.&lt;br /&gt;
 &lt;br /&gt;
end implement human&lt;br /&gt;
 &lt;br /&gt;
/******************************************&lt;br /&gt;
  Class Сomputer&lt;br /&gt;
******************************************/&lt;br /&gt;
class computer:player&lt;br /&gt;
predicates&lt;br /&gt;
    classInfo : core::classInfo.&lt;br /&gt;
end class computer&lt;br /&gt;
 &lt;br /&gt;
implement computer&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;Computer&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    move():-&lt;br /&gt;
        Cell=resolveMove(),&lt;br /&gt;
        game::set(toString(Cell)).&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    resolveMove:()-&amp;gt;game::cell.&lt;br /&gt;
clauses&lt;br /&gt;
    resolveMove()=Cell:-&lt;br /&gt;
        Cell=successfulMove(game::polyline_P),&lt;br /&gt;
        !.&lt;br /&gt;
    resolveMove()=Cell:-&lt;br /&gt;
        moveCandidate(game::polyline_P,_PolyLine,Cell),&lt;br /&gt;
        !.&lt;br /&gt;
    resolveMove()=game::c(X+1,Y+1):-&lt;br /&gt;
        X=math::random(game::maxColumn_C-1),&lt;br /&gt;
        Y=math::random(game::maxRow_C-1).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    successfulMove: (game::cell*)-&amp;gt;game::cell nondeterm.&lt;br /&gt;
clauses&lt;br /&gt;
    successfulMove(PolyLine)=Cell:-&lt;br /&gt;
        moveCandidate(PolyLine,_PolyLine1,Cell),&lt;br /&gt;
            list::isMember(Cell, PolyLine),&lt;br /&gt;
            !.&lt;br /&gt;
    successfulMove(PolyLine)=Cell:-&lt;br /&gt;
        moveCandidate(PolyLine, PolyLine1, Cell),&lt;br /&gt;
            not(_=successfulMove(PolyLine1)).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    moveCandidate: (game::cell*,game::cell* [out],game::cell [out]) nondeterm.&lt;br /&gt;
clauses&lt;br /&gt;
    moveCandidate([Cell],[Cell,NewCell], NewCell):-&lt;br /&gt;
        game::rule_nd(Cell, NewCell),&lt;br /&gt;
        !.&lt;br /&gt;
    moveCandidate([Left, RestrictingCell | PolyLine],[NewCell,Left, RestrictingCell| PolyLine], NewCell):-&lt;br /&gt;
        NewCell=game::ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    moveCandidate(PolyLine,list::reverse([NewCell,Left, RestrictingCell |PolyLineTail]),NewCell):-&lt;br /&gt;
        [Left, RestrictingCell |PolyLineTail] = list::reverse(PolyLine),&lt;br /&gt;
        NewCell=game::ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
 &lt;br /&gt;
end implement computer&lt;br /&gt;
 &lt;br /&gt;
/******************************************&lt;br /&gt;
  Class HumanInterface supports the communication&lt;br /&gt;
  of the human with the computer&lt;br /&gt;
******************************************/&lt;br /&gt;
class humanInterface&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    showStage:().&lt;br /&gt;
    showMove:(game::cell,game::moveType_D).&lt;br /&gt;
    getInput:(inputType_D)-&amp;gt;string InputString.&lt;br /&gt;
 &lt;br /&gt;
domains&lt;br /&gt;
    inputType_D=&lt;br /&gt;
        playerMove_S;&lt;br /&gt;
        playerTurn_S.&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    announceStarter:(string Name).&lt;br /&gt;
    announceMovingPlayer:(string Name).&lt;br /&gt;
    announceWin:(string Name).&lt;br /&gt;
    announceError:(string Description).&lt;br /&gt;
    announceError:().&lt;br /&gt;
 &lt;br /&gt;
domains&lt;br /&gt;
    choiceError_D=&lt;br /&gt;
        errorMustBeNumber_S;&lt;br /&gt;
        errorPlayerTurn_S.&lt;br /&gt;
predicates&lt;br /&gt;
    announceChoiceError:(choiceError_D).&lt;br /&gt;
 &lt;br /&gt;
end class humanInterface&lt;br /&gt;
 &lt;br /&gt;
implement humanInterface&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    cellMarkedOrdinary_C=&amp;quot;*&amp;quot;.&lt;br /&gt;
    cellMarkedWinner_C=&amp;quot;O&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
constants % messages&lt;br /&gt;
    movingPlayer_C=&amp;quot;% is thinking&amp;quot;.&lt;br /&gt;
    beginner_C=&amp;quot;First move done by: %&amp;quot;.&lt;br /&gt;
    error_C=&amp;quot;Error, % &amp;quot;.&lt;br /&gt;
    congratulation_C=&amp;quot;Player % has won!&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
    playerMove_C=&amp;quot;Enter the move as  c(X,Y): &amp;quot;.&lt;br /&gt;
    playerTurn_C=&amp;quot;\nWho is moving first (1-human, 2-computer, Enter-exit)?:&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
    errorMustBeNumber_C=&amp;quot;\nIt must be numeric! Please repeat the input:&amp;quot;.&lt;br /&gt;
    errorPlayerTurn_C=&amp;quot;\nNo player with this ID! Please repeat the input:&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    verticalSpace_C=2.&lt;br /&gt;
    horizontalSpace_C=3.&lt;br /&gt;
    emptyLineLenght_C=80.&lt;br /&gt;
 &lt;br /&gt;
constants % Position of Line&lt;br /&gt;
    starterLine_C=1.&lt;br /&gt;
    announceLine_C=starterLine_C+1.&lt;br /&gt;
    actionLine_C=announceLine_C+1.&lt;br /&gt;
    polylineLine_C=actionLine_C+1.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    getInput(InputType)=Input:-&lt;br /&gt;
        inputInvitation(InputType),&lt;br /&gt;
        Input = console::readLine(),&lt;br /&gt;
        console::clearInput().&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    inputInvitation:(inputType_D).&lt;br /&gt;
clauses&lt;br /&gt;
    inputInvitation(playermove_S):-&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(actionLine_C,&amp;quot;%&amp;quot;,playermove_C).&lt;br /&gt;
    inputInvitation(playerTurn_S):-&lt;br /&gt;
        console::clearOutput(),&lt;br /&gt;
        console::write(playerTurn_C).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    showStage():-&lt;br /&gt;
        console::clearOutput(),&lt;br /&gt;
        foreach I = std::fromTo(1, game::maxColumn_C) do&lt;br /&gt;
            console::setLocation(console_native::coord(horizontalSpace_C*I, 0)),&lt;br /&gt;
            console::write(I)&lt;br /&gt;
        end foreach,&lt;br /&gt;
        foreach J = std::fromTo(1, game::maxRow_C) do&lt;br /&gt;
            console::setLocation(console_native::coord(0, verticalSpace_C*J)),&lt;br /&gt;
            console::write(J)&lt;br /&gt;
        end foreach.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    showMove(game::c(X,Y),_Type):-&lt;br /&gt;
        console::setLocation(console_native::coord(horizontalSpace_C*X, verticalSpace_C*Y)),&lt;br /&gt;
        fail.&lt;br /&gt;
    showMove(_Cell,game::ordinary_S):-&lt;br /&gt;
        console::write(cellMarkedOrdinary_C).&lt;br /&gt;
    showMove(_Cell,game::winner_S):-&lt;br /&gt;
        console::write(cellMarkedWinner_C).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceStarter(Name):-&lt;br /&gt;
        clearMessageArea(starterLine_C),&lt;br /&gt;
        writeMessage(starterLine_C,beginner_C,Name).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceChoiceError(errorMustBeNumber_S):-&lt;br /&gt;
        console::write(errorMustBeNumber_C),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
    announceChoiceError(errorPlayerTurn_S):-&lt;br /&gt;
        console::write(errorPlayerTurn_C),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceError():-&lt;br /&gt;
        announceError(&amp;quot;&amp;quot;).&lt;br /&gt;
 &lt;br /&gt;
    announceError(ErrorText):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        writeMessage(announceLine_C,error_C,ErrorText).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceWin(Name):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        writeMessage(announceLine_C,congratulation_C,Name),&lt;br /&gt;
        showPolyLine(),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceMovingPlayer(Name):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(actionLine_C,movingPlayer_C,Name).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    showPolyLine:().&lt;br /&gt;
clauses&lt;br /&gt;
    showPolyLine():-&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(polylineLine_C,&amp;quot;%&amp;quot;,toString(game::polyline_P)).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    clearMessageArea:(positive AreaID).&lt;br /&gt;
clauses&lt;br /&gt;
    clearMessageArea(AreaID):-&lt;br /&gt;
        console::setLocation(console_native::coord(0,game::maxRow_C*verticalSpace_C+AreaID)),&lt;br /&gt;
        console::write(string::create(emptyLineLenght_C,&amp;quot; &amp;quot;)).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    writeMessage:(positive AreaID,string FormatString,string ParameterString).&lt;br /&gt;
clauses&lt;br /&gt;
    writeMessage(AreaID,FormatString,ParameterString):-&lt;br /&gt;
        console::setLocation(console_native::coord(0, game::maxRow_C*verticalSpace_C+AreaID)),&lt;br /&gt;
        console::writef(FormatString,ParameterString).&lt;br /&gt;
 &lt;br /&gt;
end implement humanInterface&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
/*******************************************&lt;br /&gt;
VIP 7.1&lt;br /&gt;
Written by: Victor Yukhtenko&lt;br /&gt;
&lt;br /&gt;
Predicates, which represent the strategy&lt;br /&gt;
  resolveMove,&lt;br /&gt;
  moveCandidate,&lt;br /&gt;
  successfulMove,&lt;br /&gt;
  rule_nd,&lt;br /&gt;
based on solutions proposed by Elena Efimova&lt;br /&gt;
********************************************/&lt;br /&gt;
goal&lt;br /&gt;
    mainExe::run(main::run).&lt;br /&gt;
&lt;br /&gt;
implement main&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;PolyLine&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        console::init(),&lt;br /&gt;
        game::run().&lt;br /&gt;
end implement main&lt;br /&gt;
&lt;br /&gt;
/**************************************&lt;br /&gt;
The Game class manages the playing process&lt;br /&gt;
**************************************/&lt;br /&gt;
class game&lt;br /&gt;
    open core&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    classInfo : core::classInfo.&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    maxRow_C:positive=6.&lt;br /&gt;
    maxColumn_C:positive=6.&lt;br /&gt;
&lt;br /&gt;
domains&lt;br /&gt;
    cell = c(positive,positive).&lt;br /&gt;
    moveType_D=&lt;br /&gt;
        ordinary_S;&lt;br /&gt;
        winner_S.&lt;br /&gt;
&lt;br /&gt;
properties&lt;br /&gt;
    polyline_P:cell*.&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    run:().&lt;br /&gt;
    set:(string CellAsString).&lt;br /&gt;
    rule_nd: (cell,cell) nondeterm (i,o) (i,i).&lt;br /&gt;
    ruleLimited_nd:(cell,cell)-&amp;gt;cell nondeterm.&lt;br /&gt;
&lt;br /&gt;
end class game&lt;br /&gt;
&lt;br /&gt;
implement game&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;Game&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
&lt;br /&gt;
class facts&lt;br /&gt;
    human_V:player:=erroneous.&lt;br /&gt;
    computer_V:player:=erroneous.&lt;br /&gt;
    polyline_P:cell*:=[].&lt;br /&gt;
    endOfGame_V:boolean:=false.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        human_V:=human::new(),&lt;br /&gt;
        computer_V:=computer::new(),&lt;br /&gt;
        playerTurn().&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    playerTurn:().&lt;br /&gt;
clauses&lt;br /&gt;
    playerTurn():-&lt;br /&gt;
        PlayerTurnStr=humanInterface::getInput(humanInterface::playerTurn_S),&lt;br /&gt;
        not(PlayerTurnStr=&amp;quot;&amp;quot;),&lt;br /&gt;
        try&lt;br /&gt;
            hasDomain(positive,PlayerTurn),&lt;br /&gt;
            PlayerTurn=toTerm(PlayerTurnStr),&lt;br /&gt;
            if PlayerTurn=2 then&lt;br /&gt;
                Player=human_V,&lt;br /&gt;
                StarterName=&amp;quot;Computer&amp;quot; % because of it is used NextPlayer in the Play predicate&lt;br /&gt;
            else&lt;br /&gt;
                Player=computer_V,&lt;br /&gt;
                StarterName=&amp;quot;Human&amp;quot;&lt;br /&gt;
            end if,&lt;br /&gt;
            humanInterface::showStage(),&lt;br /&gt;
            !,&lt;br /&gt;
            humanInterface::announceStarter(StarterName),&lt;br /&gt;
            play(Player)&lt;br /&gt;
        catch _TraceID1 do&lt;br /&gt;
            humanInterface::announceChoiceError(humanInterface::errorMustBeNumber_S)&lt;br /&gt;
        end try,&lt;br /&gt;
            !,&lt;br /&gt;
            polyline_P:=[],&lt;br /&gt;
            endOfGame_V:=false,&lt;br /&gt;
            playerTurn().&lt;br /&gt;
    playerTurn().&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    play:(player Player).&lt;br /&gt;
clauses&lt;br /&gt;
    play(Player):-&lt;br /&gt;
        endOfGame_V=true,&lt;br /&gt;
        !,&lt;br /&gt;
        if Player=human_V then&lt;br /&gt;
            humanInterface::announceWin(&amp;quot;Human&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
            humanInterface::announceWin(&amp;quot;Computer&amp;quot;)&lt;br /&gt;
        end if.&lt;br /&gt;
    play(Player):-&lt;br /&gt;
        if Player=human_V then&lt;br /&gt;
            NextPlayer=computer_V,&lt;br /&gt;
            Name=&amp;quot;Computer&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            NextPlayer=human_V,&lt;br /&gt;
            Name=&amp;quot;Human&amp;quot;&lt;br /&gt;
        end if,&lt;br /&gt;
        !,&lt;br /&gt;
        humanInterface::announceMovingPlayer(Name),&lt;br /&gt;
        NextPlayer:move(),&lt;br /&gt;
        play(NextPlayer).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    set(InputString):-&lt;br /&gt;
        Cell=toTerm(InputString),&lt;br /&gt;
        handleInput (Cell).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    handleInput:(cell Cell).&lt;br /&gt;
clauses&lt;br /&gt;
    handleInput(Cell):-&lt;br /&gt;
        list::isMember(Cell,polyline_P),&lt;br /&gt;
        try&lt;br /&gt;
            _=makePolyLine(Cell,polyline_P)   % If the Cell is not acceptable,&lt;br /&gt;
                                                            % then exception appears and we ignore it&lt;br /&gt;
                                                            % using fail&lt;br /&gt;
        catch _TraceID do&lt;br /&gt;
            fail&lt;br /&gt;
        end try,&lt;br /&gt;
        !,&lt;br /&gt;
        endOfGame_V:=true,&lt;br /&gt;
        humanInterface::showMove(Cell,winner_S).&lt;br /&gt;
    handleInput (Cell):-&lt;br /&gt;
        polyline_P:=makePolyLine(Cell,polyline_P),&lt;br /&gt;
        !,&lt;br /&gt;
        humanInterface::showMove(Cell,ordinary_S).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    makePolyLine: (cell,cell*)-&amp;gt; cell* multi.&lt;br /&gt;
clauses&lt;br /&gt;
    makePolyLine(c(X,Y),[])=[c(X,Y)]:-&lt;br /&gt;
        X&amp;gt;0,X&amp;lt;=maxColumn_C,&lt;br /&gt;
        Y&amp;gt;0,Y&amp;lt;=maxRow_C,&lt;br /&gt;
        !.&lt;br /&gt;
    makePolyLine(NewCell,[SingleCell])=[NewCell,SingleCell]:-&lt;br /&gt;
        game::rule_nd(SingleCell, NewCell),&lt;br /&gt;
        !.&lt;br /&gt;
    makePolyLine(NewCell,[Left, RestrictingCell | PolyLineTail])=[NewCell, Left, RestrictingCell | PolyLineTail]:-&lt;br /&gt;
        NewCell=ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    makePolyLine(NewCell,PolyLine)=list::reverse([NewCell,Left, RestrictingCell | PolyLineTail]):-&lt;br /&gt;
        [Left, RestrictingCell | PolyLineTail]= list::reverse(PolyLine),&lt;br /&gt;
        NewCell=ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    makePolyLine(NewCell,_PolyLine)= _PolyLine1:-&lt;br /&gt;
        exception::raise(classInfo,wrongMoveException,[namedValue(&amp;quot;data&amp;quot;,string(toString(NewCell)))]).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    wrongMoveException:exception.&lt;br /&gt;
clauses&lt;br /&gt;
    wrongMoveException&lt;br /&gt;
        (&lt;br /&gt;
        classInfo,&lt;br /&gt;
        predicate_Name(),&lt;br /&gt;
        &amp;quot;The point % can not prolong the polyline!&amp;quot;&lt;br /&gt;
        ).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    ruleLimited_nd(Cell,RestrictingCell)=NewCell:-&lt;br /&gt;
        rule_nd(Cell,NewCell),&lt;br /&gt;
            not(NewCell = RestrictingCell).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    rule_nd(c(X, Y), c(X + 1, Y)):- X &amp;lt; maxColumn_C.&lt;br /&gt;
    rule_nd(c(X, Y), c(X, Y + 1)):- Y &amp;lt; maxrow_C.&lt;br /&gt;
    rule_nd(c(X, Y), c(X - 1, Y)):- X &amp;gt; 1.&lt;br /&gt;
    rule_nd(c(X, Y), c(X, Y - 1)):- Y &amp;gt; 1.&lt;br /&gt;
&lt;br /&gt;
end implement game&lt;br /&gt;
&lt;br /&gt;
/******************************************&lt;br /&gt;
  Interface Player&lt;br /&gt;
  Player in responce to predicate call move()&lt;br /&gt;
  must  reply by calling set(ResponceMove)&lt;br /&gt;
******************************************/&lt;br /&gt;
interface player&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    move:().&lt;br /&gt;
end interface player&lt;br /&gt;
&lt;br /&gt;
/********************************&lt;br /&gt;
  The Class Human&lt;br /&gt;
********************************/&lt;br /&gt;
class human:player&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
end class human&lt;br /&gt;
&lt;br /&gt;
implement human&lt;br /&gt;
open core, exception&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    move():-&lt;br /&gt;
        InputString=humanInterface::getInput(humanInterface::playerMove_S),&lt;br /&gt;
        try&lt;br /&gt;
            game::set(InputString)&lt;br /&gt;
        catch TraceID do&lt;br /&gt;
            handleException(TraceID),&lt;br /&gt;
            fail&lt;br /&gt;
        end try,&lt;br /&gt;
        !.&lt;br /&gt;
    move():-&lt;br /&gt;
        move().&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    handleException:(exception::traceId TraceID).&lt;br /&gt;
clauses&lt;br /&gt;
    handleException(TraceID):-&lt;br /&gt;
        foreach Descriptor=exception::getDescriptor_nd(TraceID) do&lt;br /&gt;
            Descriptor = exception::descriptor(&lt;br /&gt;
                _ClassInfo1,&lt;br /&gt;
                exception::exceptionDescriptor(_ClassInfo2,_PredicateName,Description),&lt;br /&gt;
                _Kind,&lt;br /&gt;
                ExtraInfo,&lt;br /&gt;
                _GMTTime,&lt;br /&gt;
                _ExceptionDescription,&lt;br /&gt;
                _ThreadId),&lt;br /&gt;
            if&lt;br /&gt;
                ExtraInfo=[namedValue(&amp;quot;data&amp;quot;,string(CellPointer))]&lt;br /&gt;
            then&lt;br /&gt;
                ErrorMsg=string::format(Description,CellPointer),&lt;br /&gt;
                humanInterface::announceError(ErrorMsg)&lt;br /&gt;
            else&lt;br /&gt;
                humanInterface::announceError(&amp;quot;&amp;quot;)&lt;br /&gt;
            end if&lt;br /&gt;
        end foreach.&lt;br /&gt;
&lt;br /&gt;
end implement human&lt;br /&gt;
&lt;br /&gt;
/******************************************&lt;br /&gt;
  Class Сomputer&lt;br /&gt;
******************************************/&lt;br /&gt;
class computer:player&lt;br /&gt;
predicates&lt;br /&gt;
    classInfo : core::classInfo.&lt;br /&gt;
end class computer&lt;br /&gt;
&lt;br /&gt;
implement computer&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;Computer&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    move():-&lt;br /&gt;
        Cell=resolveMove(),&lt;br /&gt;
        game::set(toString(Cell)).&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    resolveMove:()-&amp;gt;game::cell.&lt;br /&gt;
clauses&lt;br /&gt;
    resolveMove()=Cell:-&lt;br /&gt;
        Cell=successfulMove(game::polyline_P),&lt;br /&gt;
        !.&lt;br /&gt;
    resolveMove()=Cell:-&lt;br /&gt;
        moveCandidate(game::polyline_P,_PolyLine,Cell),&lt;br /&gt;
        !.&lt;br /&gt;
    resolveMove()=game::c(X+1,Y+1):-&lt;br /&gt;
        X=math::random(game::maxColumn_C-1),&lt;br /&gt;
        Y=math::random(game::maxRow_C-1).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    successfulMove: (game::cell*)-&amp;gt;game::cell nondeterm.&lt;br /&gt;
clauses&lt;br /&gt;
    successfulMove(PolyLine)=Cell:-&lt;br /&gt;
        moveCandidate(PolyLine,_PolyLine1,Cell),&lt;br /&gt;
            list::isMember(Cell, PolyLine),&lt;br /&gt;
            !.&lt;br /&gt;
    successfulMove(PolyLine)=Cell:-&lt;br /&gt;
        moveCandidate(PolyLine, PolyLine1, Cell),&lt;br /&gt;
            not(_=successfulMove(PolyLine1)).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    moveCandidate: (game::cell*,game::cell* [out],game::cell [out]) nondeterm.&lt;br /&gt;
clauses&lt;br /&gt;
    moveCandidate([Cell],[Cell,NewCell], NewCell):-&lt;br /&gt;
        game::rule_nd(Cell, NewCell),&lt;br /&gt;
        !.&lt;br /&gt;
    moveCandidate([Left, RestrictingCell | PolyLine],[NewCell,Left, RestrictingCell| PolyLine], NewCell):-&lt;br /&gt;
        NewCell=game::ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    moveCandidate(PolyLine,list::reverse([NewCell,Left, RestrictingCell |PolyLineTail]),NewCell):-&lt;br /&gt;
        [Left, RestrictingCell |PolyLineTail] = list::reverse(PolyLine),&lt;br /&gt;
        NewCell=game::ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
&lt;br /&gt;
end implement computer&lt;br /&gt;
&lt;br /&gt;
/******************************************&lt;br /&gt;
  Class HumanInterface supports the communication&lt;br /&gt;
  of the human with the computer&lt;br /&gt;
******************************************/&lt;br /&gt;
class humanInterface&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    showStage:().&lt;br /&gt;
    showMove:(game::cell,game::moveType_D).&lt;br /&gt;
    getInput:(inputType_D)-&amp;gt;string InputString.&lt;br /&gt;
&lt;br /&gt;
domains&lt;br /&gt;
    inputType_D=&lt;br /&gt;
        playerMove_S;&lt;br /&gt;
        playerTurn_S.&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    announceStarter:(string Name).&lt;br /&gt;
    announceMovingPlayer:(string Name).&lt;br /&gt;
    announceWin:(string Name).&lt;br /&gt;
    announceError:(string Description).&lt;br /&gt;
    announceError:().&lt;br /&gt;
&lt;br /&gt;
domains&lt;br /&gt;
    choiceError_D=&lt;br /&gt;
        errorMustBeNumber_S;&lt;br /&gt;
        errorPlayerTurn_S.&lt;br /&gt;
predicates&lt;br /&gt;
    announceChoiceError:(choiceError_D).&lt;br /&gt;
&lt;br /&gt;
end class humanInterface&lt;br /&gt;
&lt;br /&gt;
implement humanInterface&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    cellMarkedOrdinary_C=&amp;quot;*&amp;quot;.&lt;br /&gt;
    cellMarkedWinner_C=&amp;quot;O&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
constants % messages&lt;br /&gt;
    movingPlayer_C=&amp;quot;% is thinking&amp;quot;.&lt;br /&gt;
    beginner_C=&amp;quot;First move done by: %&amp;quot;.&lt;br /&gt;
    error_C=&amp;quot;Error, % &amp;quot;.&lt;br /&gt;
    congratulation_C=&amp;quot;Player % has won!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    playerMove_C=&amp;quot;Enter the move as  c(X,Y): &amp;quot;.&lt;br /&gt;
    playerTurn_C=&amp;quot;\nWho is moving first (1-human, 2-computer, Enter-exit)?:&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    errorMustBeNumber_C=&amp;quot;\nIt must be numeric! Please repeat the input:&amp;quot;.&lt;br /&gt;
    errorPlayerTurn_C=&amp;quot;\nNo player with this ID! Please repeat the input:&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    verticalSpace_C=2.&lt;br /&gt;
    horizontalSpace_C=3.&lt;br /&gt;
    emptyLineLenght_C=80.&lt;br /&gt;
&lt;br /&gt;
constants % Position of Line&lt;br /&gt;
    starterLine_C=1.&lt;br /&gt;
    announceLine_C=starterLine_C+1.&lt;br /&gt;
    actionLine_C=announceLine_C+1.&lt;br /&gt;
    polylineLine_C=actionLine_C+1.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    getInput(InputType)=Input:-&lt;br /&gt;
        inputInvitation(InputType),&lt;br /&gt;
        Input = console::readLine(),&lt;br /&gt;
        console::clearInput().&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    inputInvitation:(inputType_D).&lt;br /&gt;
clauses&lt;br /&gt;
    inputInvitation(playermove_S):-&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(actionLine_C,&amp;quot;%&amp;quot;,playermove_C).&lt;br /&gt;
    inputInvitation(playerTurn_S):-&lt;br /&gt;
        console::clearOutput(),&lt;br /&gt;
        console::write(playerTurn_C).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    showStage():-&lt;br /&gt;
        console::clearOutput(),&lt;br /&gt;
        foreach I = std::fromTo(1, game::maxColumn_C) do&lt;br /&gt;
            console::setLocation(console::location(horizontalSpace_C*I, 0)),&lt;br /&gt;
            console::write(I)&lt;br /&gt;
        end foreach,&lt;br /&gt;
        foreach J = std::fromTo(1, game::maxRow_C) do&lt;br /&gt;
            console::setLocation(console::location(0, verticalSpace_C*J)),&lt;br /&gt;
            console::write(J)&lt;br /&gt;
        end foreach.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    showMove(game::c(X,Y),_Type):-&lt;br /&gt;
        console::setLocation(console::location(horizontalSpace_C*X, verticalSpace_C*Y)),&lt;br /&gt;
        fail.&lt;br /&gt;
    showMove(_Cell,game::ordinary_S):-&lt;br /&gt;
        console::write(cellMarkedOrdinary_C).&lt;br /&gt;
    showMove(_Cell,game::winner_S):-&lt;br /&gt;
        console::write(cellMarkedWinner_C).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceStarter(Name):-&lt;br /&gt;
        clearMessageArea(starterLine_C),&lt;br /&gt;
        writeMessage(starterLine_C,beginner_C,Name).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceChoiceError(errorMustBeNumber_S):-&lt;br /&gt;
        console::write(errorMustBeNumber_C),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
    announceChoiceError(errorPlayerTurn_S):-&lt;br /&gt;
        console::write(errorPlayerTurn_C),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceError():-&lt;br /&gt;
        announceError(&amp;quot;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
    announceError(ErrorText):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        writeMessage(announceLine_C,error_C,ErrorText).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceWin(Name):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        writeMessage(announceLine_C,congratulation_C,Name),&lt;br /&gt;
        showPolyLine(),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceMovingPlayer(Name):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(actionLine_C,movingPlayer_C,Name).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    showPolyLine:().&lt;br /&gt;
clauses&lt;br /&gt;
    showPolyLine():-&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(polylineLine_C,&amp;quot;%&amp;quot;,toString(game::polyline_P)).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    clearMessageArea:(positive AreaID).&lt;br /&gt;
clauses&lt;br /&gt;
    clearMessageArea(AreaID):-&lt;br /&gt;
        console::setLocation(console::location(0,game::maxRow_C*verticalSpace_C+AreaID)),&lt;br /&gt;
        console::write(string::create(emptyLineLenght_C,&amp;quot; &amp;quot;)).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    writeMessage:(positive AreaID,string FormatString,string ParameterString).&lt;br /&gt;
clauses&lt;br /&gt;
    writeMessage(AreaID,FormatString,ParameterString):-&lt;br /&gt;
        console::setLocation(console::location(0, game::maxRow_C*verticalSpace_C+AreaID)),&lt;br /&gt;
        console::writef(FormatString,ParameterString).&lt;br /&gt;
&lt;br /&gt;
end implement humanInterface&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
=References=&lt;br /&gt;
[[ru:Учебный Проект. Релиз 2]]&lt;br /&gt;
[[Category:Tutorial Project Evolutions]]&lt;/div&gt;</summary>
		<author><name>Thomas Linder Puls</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2384&amp;oldid=prev</id>
		<title>Victor Yukhtenko at 14:38, 26 May 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2384&amp;oldid=prev"/>
		<updated>2010-05-26T14:38:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:38, 26 May 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l26&quot;&gt;Line 26:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*********************************************************&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/*********************************************************&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;VIP 7.2&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;VIP 7.2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copyright (c) 2007-2008 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Prolog Development Center SPb&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copyright (c) 2007-2008 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Victor Yukhtenko&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpbSolutions/Examples/Polyline&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SpbSolutions/Examples/Polyline&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Victor Yukhtenko</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2383&amp;oldid=prev</id>
		<title>Victor Yukhtenko at 14:35, 26 May 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=2383&amp;oldid=prev"/>
		<updated>2010-05-26T14:35:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:35, 26 May 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{spbCopyright}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This program is part of the [[Tutorial Project Evolutions]] article.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This program is part of the [[Tutorial Project Evolutions]] article.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Victor Yukhtenko</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=1969&amp;oldid=prev</id>
		<title>Victor Yukhtenko: New page: This program is part of the Tutorial Project Evolutions article.  {{PolyLine Game Rules}}  {{note|content= The size of the field is 6x6.&lt;br\&gt;It is not recommended to set the size of th...</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Tutorial_Project._Release_2&amp;diff=1969&amp;oldid=prev"/>
		<updated>2009-10-20T13:50:28Z</updated>

		<summary type="html">&lt;p&gt;New page: This program is part of the &lt;a href=&quot;/index.php?title=Tutorial_Project_Evolutions&quot; class=&quot;mw-redirect&quot; title=&quot;Tutorial Project Evolutions&quot;&gt;Tutorial Project Evolutions&lt;/a&gt; article.  {{PolyLine Game Rules}}  {{note|content= The size of the field is 6x6.&amp;lt;br\&amp;gt;It is not recommended to set the size of th...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This program is part of the [[Tutorial Project Evolutions]] article.&lt;br /&gt;
&lt;br /&gt;
{{PolyLine Game Rules}}&lt;br /&gt;
&lt;br /&gt;
{{note|content=&lt;br /&gt;
The size of the field is 6x6.&amp;lt;br\&amp;gt;It is not recommended to set the size of the field more than 36 points (say 6 x 6) due to the non efficient algorithm used&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The strategy of the computer behaviour adopted from the  [[Tutorial Project. Release 1]] (written by Elena Efimova).&lt;br /&gt;
&lt;br /&gt;
Differences (relative to version 1):&lt;br /&gt;
* If the computer makes the first move, then it is done random&lt;br /&gt;
* If computer can not find the successful move, then it is done random (even if it is extremely bad)&lt;br /&gt;
* The human and computer models are object-generating classes&lt;br /&gt;
* Predicates, which relate to the human-machine interaction grouped to class HumanInterface&lt;br /&gt;
&lt;br /&gt;
To run the game please make the steps as follows: &lt;br /&gt;
&lt;br /&gt;
*Create the new project with the User Interface strategy Console&lt;br /&gt;
*In the created project replace the entire content of the file &amp;quot;main.pro&amp;quot; by the code shown below (VIP 7.1 is still there below)&lt;br /&gt;
*While building the project answer &amp;quot;Add All&amp;quot;, when any dialog with proposals to include any packages to the project appears&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
/*********************************************************&lt;br /&gt;
VIP 7.2&lt;br /&gt;
Copyright (c) 2007-2008 Prolog Development Center SPb&lt;br /&gt;
&lt;br /&gt;
SpbSolutions/Examples/Polyline&lt;br /&gt;
&lt;br /&gt;
Predicates, which represent the strategy&lt;br /&gt;
  resolveMove,&lt;br /&gt;
  moveCandidate,&lt;br /&gt;
  successfulMove,&lt;br /&gt;
  rule_nd,&lt;br /&gt;
based on solutions proposed by Elena Efimova&lt;br /&gt;
&lt;br /&gt;
Written by: Victor Yukhtenko                        &lt;br /&gt;
*********************************************************/&lt;br /&gt;
goal&lt;br /&gt;
    mainExe::run(main::run).&lt;br /&gt;
 &lt;br /&gt;
implement main&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;PolyLine&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        console::init(),&lt;br /&gt;
        game::run().&lt;br /&gt;
end implement main&lt;br /&gt;
 &lt;br /&gt;
/**************************************&lt;br /&gt;
The Game class manages the playing process&lt;br /&gt;
**************************************/&lt;br /&gt;
class game&lt;br /&gt;
    open core&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    classInfo : core::classInfo.&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    maxRow_C:positive=6.&lt;br /&gt;
    maxColumn_C:positive=6.&lt;br /&gt;
 &lt;br /&gt;
domains&lt;br /&gt;
    cell = c(positive,positive).&lt;br /&gt;
    moveType_D=&lt;br /&gt;
        ordinary_S;&lt;br /&gt;
        winner_S.&lt;br /&gt;
 &lt;br /&gt;
properties&lt;br /&gt;
    polyline_P:cell*.&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    run:().&lt;br /&gt;
    set:(string CellAsString).&lt;br /&gt;
    rule_nd: (cell,cell) nondeterm (i,o) (i,i).&lt;br /&gt;
    ruleLimited_nd:(cell,cell)-&amp;gt;cell nondeterm.&lt;br /&gt;
 &lt;br /&gt;
end class game&lt;br /&gt;
 &lt;br /&gt;
implement game&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;Game&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
 &lt;br /&gt;
class facts&lt;br /&gt;
    human_V:player:=erroneous.&lt;br /&gt;
    computer_V:player:=erroneous.&lt;br /&gt;
    polyline_P:cell*:=[].&lt;br /&gt;
    endOfGame_V:boolean:=false.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        human_V:=human::new(),&lt;br /&gt;
        computer_V:=computer::new(),&lt;br /&gt;
        playerTurn().&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    playerTurn:().&lt;br /&gt;
clauses&lt;br /&gt;
    playerTurn():-&lt;br /&gt;
        PlayerTurnStr=humanInterface::getInput(humanInterface::playerTurn_S),&lt;br /&gt;
        not(PlayerTurnStr=&amp;quot;&amp;quot;),&lt;br /&gt;
        try&lt;br /&gt;
            hasDomain(positive,PlayerTurn),&lt;br /&gt;
            PlayerTurn=toTerm(PlayerTurnStr),&lt;br /&gt;
            if PlayerTurn=2 then&lt;br /&gt;
                Player=human_V,&lt;br /&gt;
                StarterName=&amp;quot;Computer&amp;quot; % because of it is used NextPlayer in the Play predicate&lt;br /&gt;
            else&lt;br /&gt;
                Player=computer_V,&lt;br /&gt;
                StarterName=&amp;quot;Human&amp;quot;&lt;br /&gt;
            end if,&lt;br /&gt;
            humanInterface::showStage(),&lt;br /&gt;
            !,&lt;br /&gt;
            humanInterface::announceStarter(StarterName),&lt;br /&gt;
            play(Player)&lt;br /&gt;
        catch _TraceID1 do&lt;br /&gt;
            humanInterface::announceChoiceError(humanInterface::errorMustBeNumber_S)&lt;br /&gt;
        end try,&lt;br /&gt;
            !,&lt;br /&gt;
            polyline_P:=[],&lt;br /&gt;
            endOfGame_V:=false,&lt;br /&gt;
            playerTurn().&lt;br /&gt;
    playerTurn().&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    play:(player Player).&lt;br /&gt;
clauses&lt;br /&gt;
    play(Player):-&lt;br /&gt;
        endOfGame_V=true,&lt;br /&gt;
        !,&lt;br /&gt;
        if Player=human_V then&lt;br /&gt;
            humanInterface::announceWin(&amp;quot;Human&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
            humanInterface::announceWin(&amp;quot;Computer&amp;quot;)&lt;br /&gt;
        end if.&lt;br /&gt;
    play(Player):-&lt;br /&gt;
        if Player=human_V then&lt;br /&gt;
            NextPlayer=computer_V,&lt;br /&gt;
            Name=&amp;quot;Computer&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            NextPlayer=human_V,&lt;br /&gt;
            Name=&amp;quot;Human&amp;quot;&lt;br /&gt;
        end if,&lt;br /&gt;
        !,&lt;br /&gt;
        humanInterface::announceMovingPlayer(Name),&lt;br /&gt;
        NextPlayer:move(),&lt;br /&gt;
        play(NextPlayer).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    set(InputString):-&lt;br /&gt;
        Cell=toTerm(InputString),&lt;br /&gt;
        handleInput (Cell).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    handleInput:(cell Cell).&lt;br /&gt;
clauses&lt;br /&gt;
    handleInput(Cell):-&lt;br /&gt;
        list::isMember(Cell,polyline_P),&lt;br /&gt;
        try&lt;br /&gt;
            _=makePolyLine(Cell,polyline_P)   % If the Cell is not acceptable,&lt;br /&gt;
                                                            % then exception appears and we ignore it&lt;br /&gt;
                                                            % using fail&lt;br /&gt;
        catch _TraceID do&lt;br /&gt;
            fail&lt;br /&gt;
        end try,&lt;br /&gt;
        !,&lt;br /&gt;
        endOfGame_V:=true,&lt;br /&gt;
        humanInterface::showMove(Cell,winner_S).&lt;br /&gt;
    handleInput (Cell):-&lt;br /&gt;
        polyline_P:=makePolyLine(Cell,polyline_P),&lt;br /&gt;
        !,&lt;br /&gt;
        humanInterface::showMove(Cell,ordinary_S).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    makePolyLine: (cell,cell*)-&amp;gt; cell* multi.&lt;br /&gt;
clauses&lt;br /&gt;
    makePolyLine(c(X,Y),[])=[c(X,Y)]:-&lt;br /&gt;
        X&amp;gt;0,X&amp;lt;=maxColumn_C,&lt;br /&gt;
        Y&amp;gt;0,Y&amp;lt;=maxRow_C,&lt;br /&gt;
        !.&lt;br /&gt;
    makePolyLine(NewCell,[SingleCell])=[NewCell,SingleCell]:-&lt;br /&gt;
        game::rule_nd(SingleCell, NewCell),&lt;br /&gt;
        !.&lt;br /&gt;
    makePolyLine(NewCell,[Left, RestrictingCell | PolyLineTail])=[NewCell, Left, RestrictingCell | PolyLineTail]:-&lt;br /&gt;
        NewCell=ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    makePolyLine(NewCell,PolyLine)=list::reverse([NewCell,Left, RestrictingCell | PolyLineTail]):-&lt;br /&gt;
        [Left, RestrictingCell | PolyLineTail]= list::reverse(PolyLine),&lt;br /&gt;
        NewCell=ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    makePolyLine(NewCell,_PolyLine)= _PolyLine1:-&lt;br /&gt;
        exception::raise(classInfo,wrongMoveException,[namedValue(&amp;quot;data&amp;quot;,string(toString(NewCell)))]).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    wrongMoveException:exception.&lt;br /&gt;
clauses&lt;br /&gt;
    wrongMoveException&lt;br /&gt;
        (&lt;br /&gt;
        classInfo,&lt;br /&gt;
        predicate_Name(),&lt;br /&gt;
        &amp;quot;The point % can not prolong the polyline!&amp;quot;&lt;br /&gt;
        ).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    ruleLimited_nd(Cell,RestrictingCell)=NewCell:-&lt;br /&gt;
        rule_nd(Cell,NewCell),&lt;br /&gt;
            not(NewCell = RestrictingCell).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    rule_nd(c(X, Y), c(X + 1, Y)):- X &amp;lt; maxColumn_C.&lt;br /&gt;
    rule_nd(c(X, Y), c(X, Y + 1)):- Y &amp;lt; maxrow_C.&lt;br /&gt;
    rule_nd(c(X, Y), c(X - 1, Y)):- X &amp;gt; 1.&lt;br /&gt;
    rule_nd(c(X, Y), c(X, Y - 1)):- Y &amp;gt; 1.&lt;br /&gt;
 &lt;br /&gt;
end implement game&lt;br /&gt;
 &lt;br /&gt;
/******************************************&lt;br /&gt;
  Interface Player&lt;br /&gt;
  Player in responce to predicate call move()&lt;br /&gt;
  must  reply by calling set(ResponceMove)&lt;br /&gt;
******************************************/&lt;br /&gt;
interface player&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    move:().&lt;br /&gt;
end interface player&lt;br /&gt;
 &lt;br /&gt;
/********************************&lt;br /&gt;
  The Class Human&lt;br /&gt;
********************************/&lt;br /&gt;
class human:player&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
end class human&lt;br /&gt;
 &lt;br /&gt;
implement human&lt;br /&gt;
open core, exception&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    move():-&lt;br /&gt;
        InputString=humanInterface::getInput(humanInterface::playerMove_S),&lt;br /&gt;
        try&lt;br /&gt;
            game::set(InputString)&lt;br /&gt;
        catch TraceID do&lt;br /&gt;
            handleException(TraceID),&lt;br /&gt;
            fail&lt;br /&gt;
        end try,&lt;br /&gt;
        !.&lt;br /&gt;
    move():-&lt;br /&gt;
        move().&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    handleException:(exception::traceId TraceID).&lt;br /&gt;
clauses&lt;br /&gt;
    handleException(TraceID):-&lt;br /&gt;
        foreach Descriptor=exception::getDescriptor_nd(TraceID) do&lt;br /&gt;
            Descriptor = exception::descriptor(&lt;br /&gt;
                _ClassInfo1,&lt;br /&gt;
                exception::exceptionDescriptor(_ClassInfo2,_PredicateName,Description),&lt;br /&gt;
                _Kind,&lt;br /&gt;
                ExtraInfo,&lt;br /&gt;
                _GMTTime,&lt;br /&gt;
                _ExceptionDescription,&lt;br /&gt;
                _ThreadId),&lt;br /&gt;
            if&lt;br /&gt;
                ExtraInfo=[namedValue(&amp;quot;data&amp;quot;,string(CellPointer))]&lt;br /&gt;
            then&lt;br /&gt;
                ErrorMsg=string::format(Description,CellPointer),&lt;br /&gt;
                humanInterface::announceError(ErrorMsg)&lt;br /&gt;
            else&lt;br /&gt;
                humanInterface::announceError(&amp;quot;&amp;quot;)&lt;br /&gt;
            end if&lt;br /&gt;
        end foreach.&lt;br /&gt;
 &lt;br /&gt;
end implement human&lt;br /&gt;
 &lt;br /&gt;
/******************************************&lt;br /&gt;
  Class Сomputer&lt;br /&gt;
******************************************/&lt;br /&gt;
class computer:player&lt;br /&gt;
predicates&lt;br /&gt;
    classInfo : core::classInfo.&lt;br /&gt;
end class computer&lt;br /&gt;
 &lt;br /&gt;
implement computer&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;Computer&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    move():-&lt;br /&gt;
        Cell=resolveMove(),&lt;br /&gt;
        game::set(toString(Cell)).&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    resolveMove:()-&amp;gt;game::cell.&lt;br /&gt;
clauses&lt;br /&gt;
    resolveMove()=Cell:-&lt;br /&gt;
        Cell=successfulMove(game::polyline_P),&lt;br /&gt;
        !.&lt;br /&gt;
    resolveMove()=Cell:-&lt;br /&gt;
        moveCandidate(game::polyline_P,_PolyLine,Cell),&lt;br /&gt;
        !.&lt;br /&gt;
    resolveMove()=game::c(X+1,Y+1):-&lt;br /&gt;
        X=math::random(game::maxColumn_C-1),&lt;br /&gt;
        Y=math::random(game::maxRow_C-1).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    successfulMove: (game::cell*)-&amp;gt;game::cell nondeterm.&lt;br /&gt;
clauses&lt;br /&gt;
    successfulMove(PolyLine)=Cell:-&lt;br /&gt;
        moveCandidate(PolyLine,_PolyLine1,Cell),&lt;br /&gt;
            list::isMember(Cell, PolyLine),&lt;br /&gt;
            !.&lt;br /&gt;
    successfulMove(PolyLine)=Cell:-&lt;br /&gt;
        moveCandidate(PolyLine, PolyLine1, Cell),&lt;br /&gt;
            not(_=successfulMove(PolyLine1)).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    moveCandidate: (game::cell*,game::cell* [out],game::cell [out]) nondeterm.&lt;br /&gt;
clauses&lt;br /&gt;
    moveCandidate([Cell],[Cell,NewCell], NewCell):-&lt;br /&gt;
        game::rule_nd(Cell, NewCell),&lt;br /&gt;
        !.&lt;br /&gt;
    moveCandidate([Left, RestrictingCell | PolyLine],[NewCell,Left, RestrictingCell| PolyLine], NewCell):-&lt;br /&gt;
        NewCell=game::ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    moveCandidate(PolyLine,list::reverse([NewCell,Left, RestrictingCell |PolyLineTail]),NewCell):-&lt;br /&gt;
        [Left, RestrictingCell |PolyLineTail] = list::reverse(PolyLine),&lt;br /&gt;
        NewCell=game::ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
 &lt;br /&gt;
end implement computer&lt;br /&gt;
 &lt;br /&gt;
/******************************************&lt;br /&gt;
  Class HumanInterface supports the communication&lt;br /&gt;
  of the human with the computer&lt;br /&gt;
******************************************/&lt;br /&gt;
class humanInterface&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    showStage:().&lt;br /&gt;
    showMove:(game::cell,game::moveType_D).&lt;br /&gt;
    getInput:(inputType_D)-&amp;gt;string InputString.&lt;br /&gt;
 &lt;br /&gt;
domains&lt;br /&gt;
    inputType_D=&lt;br /&gt;
        playerMove_S;&lt;br /&gt;
        playerTurn_S.&lt;br /&gt;
 &lt;br /&gt;
predicates&lt;br /&gt;
    announceStarter:(string Name).&lt;br /&gt;
    announceMovingPlayer:(string Name).&lt;br /&gt;
    announceWin:(string Name).&lt;br /&gt;
    announceError:(string Description).&lt;br /&gt;
    announceError:().&lt;br /&gt;
 &lt;br /&gt;
domains&lt;br /&gt;
    choiceError_D=&lt;br /&gt;
        errorMustBeNumber_S;&lt;br /&gt;
        errorPlayerTurn_S.&lt;br /&gt;
predicates&lt;br /&gt;
    announceChoiceError:(choiceError_D).&lt;br /&gt;
 &lt;br /&gt;
end class humanInterface&lt;br /&gt;
 &lt;br /&gt;
implement humanInterface&lt;br /&gt;
open core&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    cellMarkedOrdinary_C=&amp;quot;*&amp;quot;.&lt;br /&gt;
    cellMarkedWinner_C=&amp;quot;O&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
constants % messages&lt;br /&gt;
    movingPlayer_C=&amp;quot;% is thinking&amp;quot;.&lt;br /&gt;
    beginner_C=&amp;quot;First move done by: %&amp;quot;.&lt;br /&gt;
    error_C=&amp;quot;Error, % &amp;quot;.&lt;br /&gt;
    congratulation_C=&amp;quot;Player % has won!&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
    playerMove_C=&amp;quot;Enter the move as  c(X,Y): &amp;quot;.&lt;br /&gt;
    playerTurn_C=&amp;quot;\nWho is moving first (1-human, 2-computer, Enter-exit)?:&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
    errorMustBeNumber_C=&amp;quot;\nIt must be numeric! Please repeat the input:&amp;quot;.&lt;br /&gt;
    errorPlayerTurn_C=&amp;quot;\nNo player with this ID! Please repeat the input:&amp;quot;.&lt;br /&gt;
 &lt;br /&gt;
constants&lt;br /&gt;
    verticalSpace_C=2.&lt;br /&gt;
    horizontalSpace_C=3.&lt;br /&gt;
    emptyLineLenght_C=80.&lt;br /&gt;
 &lt;br /&gt;
constants % Position of Line&lt;br /&gt;
    starterLine_C=1.&lt;br /&gt;
    announceLine_C=starterLine_C+1.&lt;br /&gt;
    actionLine_C=announceLine_C+1.&lt;br /&gt;
    polylineLine_C=actionLine_C+1.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    getInput(InputType)=Input:-&lt;br /&gt;
        inputInvitation(InputType),&lt;br /&gt;
        Input = console::readLine(),&lt;br /&gt;
        console::clearInput().&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    inputInvitation:(inputType_D).&lt;br /&gt;
clauses&lt;br /&gt;
    inputInvitation(playermove_S):-&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(actionLine_C,&amp;quot;%&amp;quot;,playermove_C).&lt;br /&gt;
    inputInvitation(playerTurn_S):-&lt;br /&gt;
        console::clearOutput(),&lt;br /&gt;
        console::write(playerTurn_C).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    showStage():-&lt;br /&gt;
        console::clearOutput(),&lt;br /&gt;
        foreach I = std::fromTo(1, game::maxColumn_C) do&lt;br /&gt;
            console::setLocation(console_native::coord(horizontalSpace_C*I, 0)),&lt;br /&gt;
            console::write(I)&lt;br /&gt;
        end foreach,&lt;br /&gt;
        foreach J = std::fromTo(1, game::maxRow_C) do&lt;br /&gt;
            console::setLocation(console_native::coord(0, verticalSpace_C*J)),&lt;br /&gt;
            console::write(J)&lt;br /&gt;
        end foreach.&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    showMove(game::c(X,Y),_Type):-&lt;br /&gt;
        console::setLocation(console_native::coord(horizontalSpace_C*X, verticalSpace_C*Y)),&lt;br /&gt;
        fail.&lt;br /&gt;
    showMove(_Cell,game::ordinary_S):-&lt;br /&gt;
        console::write(cellMarkedOrdinary_C).&lt;br /&gt;
    showMove(_Cell,game::winner_S):-&lt;br /&gt;
        console::write(cellMarkedWinner_C).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceStarter(Name):-&lt;br /&gt;
        clearMessageArea(starterLine_C),&lt;br /&gt;
        writeMessage(starterLine_C,beginner_C,Name).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceChoiceError(errorMustBeNumber_S):-&lt;br /&gt;
        console::write(errorMustBeNumber_C),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
    announceChoiceError(errorPlayerTurn_S):-&lt;br /&gt;
        console::write(errorPlayerTurn_C),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceError():-&lt;br /&gt;
        announceError(&amp;quot;&amp;quot;).&lt;br /&gt;
 &lt;br /&gt;
    announceError(ErrorText):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        writeMessage(announceLine_C,error_C,ErrorText).&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceWin(Name):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        writeMessage(announceLine_C,congratulation_C,Name),&lt;br /&gt;
        showPolyLine(),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
 &lt;br /&gt;
clauses&lt;br /&gt;
    announceMovingPlayer(Name):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(actionLine_C,movingPlayer_C,Name).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    showPolyLine:().&lt;br /&gt;
clauses&lt;br /&gt;
    showPolyLine():-&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(polylineLine_C,&amp;quot;%&amp;quot;,toString(game::polyline_P)).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    clearMessageArea:(positive AreaID).&lt;br /&gt;
clauses&lt;br /&gt;
    clearMessageArea(AreaID):-&lt;br /&gt;
        console::setLocation(console_native::coord(0,game::maxRow_C*verticalSpace_C+AreaID)),&lt;br /&gt;
        console::write(string::create(emptyLineLenght_C,&amp;quot; &amp;quot;)).&lt;br /&gt;
 &lt;br /&gt;
class predicates&lt;br /&gt;
    writeMessage:(positive AreaID,string FormatString,string ParameterString).&lt;br /&gt;
clauses&lt;br /&gt;
    writeMessage(AreaID,FormatString,ParameterString):-&lt;br /&gt;
        console::setLocation(console_native::coord(0, game::maxRow_C*verticalSpace_C+AreaID)),&lt;br /&gt;
        console::writef(FormatString,ParameterString).&lt;br /&gt;
 &lt;br /&gt;
end implement humanInterface&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;vip&amp;gt;&lt;br /&gt;
/*******************************************&lt;br /&gt;
VIP 7.1&lt;br /&gt;
Written by: Victor Yukhtenko&lt;br /&gt;
&lt;br /&gt;
Predicates, which represent the strategy&lt;br /&gt;
  resolveMove,&lt;br /&gt;
  moveCandidate,&lt;br /&gt;
  successfulMove,&lt;br /&gt;
  rule_nd,&lt;br /&gt;
based on solutions proposed by Elena Efimova&lt;br /&gt;
********************************************/&lt;br /&gt;
goal&lt;br /&gt;
    mainExe::run(main::run).&lt;br /&gt;
&lt;br /&gt;
implement main&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;PolyLine&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        console::init(),&lt;br /&gt;
        game::run().&lt;br /&gt;
end implement main&lt;br /&gt;
&lt;br /&gt;
/**************************************&lt;br /&gt;
The Game class manages the playing process&lt;br /&gt;
**************************************/&lt;br /&gt;
class game&lt;br /&gt;
    open core&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    classInfo : core::classInfo.&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    maxRow_C:positive=6.&lt;br /&gt;
    maxColumn_C:positive=6.&lt;br /&gt;
&lt;br /&gt;
domains&lt;br /&gt;
    cell = c(positive,positive).&lt;br /&gt;
    moveType_D=&lt;br /&gt;
        ordinary_S;&lt;br /&gt;
        winner_S.&lt;br /&gt;
&lt;br /&gt;
properties&lt;br /&gt;
    polyline_P:cell*.&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    run:().&lt;br /&gt;
    set:(string CellAsString).&lt;br /&gt;
    rule_nd: (cell,cell) nondeterm (i,o) (i,i).&lt;br /&gt;
    ruleLimited_nd:(cell,cell)-&amp;gt;cell nondeterm.&lt;br /&gt;
&lt;br /&gt;
end class game&lt;br /&gt;
&lt;br /&gt;
implement game&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;Game&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
&lt;br /&gt;
class facts&lt;br /&gt;
    human_V:player:=erroneous.&lt;br /&gt;
    computer_V:player:=erroneous.&lt;br /&gt;
    polyline_P:cell*:=[].&lt;br /&gt;
    endOfGame_V:boolean:=false.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    run():-&lt;br /&gt;
        human_V:=human::new(),&lt;br /&gt;
        computer_V:=computer::new(),&lt;br /&gt;
        playerTurn().&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    playerTurn:().&lt;br /&gt;
clauses&lt;br /&gt;
    playerTurn():-&lt;br /&gt;
        PlayerTurnStr=humanInterface::getInput(humanInterface::playerTurn_S),&lt;br /&gt;
        not(PlayerTurnStr=&amp;quot;&amp;quot;),&lt;br /&gt;
        try&lt;br /&gt;
            hasDomain(positive,PlayerTurn),&lt;br /&gt;
            PlayerTurn=toTerm(PlayerTurnStr),&lt;br /&gt;
            if PlayerTurn=2 then&lt;br /&gt;
                Player=human_V,&lt;br /&gt;
                StarterName=&amp;quot;Computer&amp;quot; % because of it is used NextPlayer in the Play predicate&lt;br /&gt;
            else&lt;br /&gt;
                Player=computer_V,&lt;br /&gt;
                StarterName=&amp;quot;Human&amp;quot;&lt;br /&gt;
            end if,&lt;br /&gt;
            humanInterface::showStage(),&lt;br /&gt;
            !,&lt;br /&gt;
            humanInterface::announceStarter(StarterName),&lt;br /&gt;
            play(Player)&lt;br /&gt;
        catch _TraceID1 do&lt;br /&gt;
            humanInterface::announceChoiceError(humanInterface::errorMustBeNumber_S)&lt;br /&gt;
        end try,&lt;br /&gt;
            !,&lt;br /&gt;
            polyline_P:=[],&lt;br /&gt;
            endOfGame_V:=false,&lt;br /&gt;
            playerTurn().&lt;br /&gt;
    playerTurn().&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    play:(player Player).&lt;br /&gt;
clauses&lt;br /&gt;
    play(Player):-&lt;br /&gt;
        endOfGame_V=true,&lt;br /&gt;
        !,&lt;br /&gt;
        if Player=human_V then&lt;br /&gt;
            humanInterface::announceWin(&amp;quot;Human&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
            humanInterface::announceWin(&amp;quot;Computer&amp;quot;)&lt;br /&gt;
        end if.&lt;br /&gt;
    play(Player):-&lt;br /&gt;
        if Player=human_V then&lt;br /&gt;
            NextPlayer=computer_V,&lt;br /&gt;
            Name=&amp;quot;Computer&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            NextPlayer=human_V,&lt;br /&gt;
            Name=&amp;quot;Human&amp;quot;&lt;br /&gt;
        end if,&lt;br /&gt;
        !,&lt;br /&gt;
        humanInterface::announceMovingPlayer(Name),&lt;br /&gt;
        NextPlayer:move(),&lt;br /&gt;
        play(NextPlayer).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    set(InputString):-&lt;br /&gt;
        Cell=toTerm(InputString),&lt;br /&gt;
        handleInput (Cell).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    handleInput:(cell Cell).&lt;br /&gt;
clauses&lt;br /&gt;
    handleInput(Cell):-&lt;br /&gt;
        list::isMember(Cell,polyline_P),&lt;br /&gt;
        try&lt;br /&gt;
            _=makePolyLine(Cell,polyline_P)   % If the Cell is not acceptable,&lt;br /&gt;
                                                            % then exception appears and we ignore it&lt;br /&gt;
                                                            % using fail&lt;br /&gt;
        catch _TraceID do&lt;br /&gt;
            fail&lt;br /&gt;
        end try,&lt;br /&gt;
        !,&lt;br /&gt;
        endOfGame_V:=true,&lt;br /&gt;
        humanInterface::showMove(Cell,winner_S).&lt;br /&gt;
    handleInput (Cell):-&lt;br /&gt;
        polyline_P:=makePolyLine(Cell,polyline_P),&lt;br /&gt;
        !,&lt;br /&gt;
        humanInterface::showMove(Cell,ordinary_S).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    makePolyLine: (cell,cell*)-&amp;gt; cell* multi.&lt;br /&gt;
clauses&lt;br /&gt;
    makePolyLine(c(X,Y),[])=[c(X,Y)]:-&lt;br /&gt;
        X&amp;gt;0,X&amp;lt;=maxColumn_C,&lt;br /&gt;
        Y&amp;gt;0,Y&amp;lt;=maxRow_C,&lt;br /&gt;
        !.&lt;br /&gt;
    makePolyLine(NewCell,[SingleCell])=[NewCell,SingleCell]:-&lt;br /&gt;
        game::rule_nd(SingleCell, NewCell),&lt;br /&gt;
        !.&lt;br /&gt;
    makePolyLine(NewCell,[Left, RestrictingCell | PolyLineTail])=[NewCell, Left, RestrictingCell | PolyLineTail]:-&lt;br /&gt;
        NewCell=ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    makePolyLine(NewCell,PolyLine)=list::reverse([NewCell,Left, RestrictingCell | PolyLineTail]):-&lt;br /&gt;
        [Left, RestrictingCell | PolyLineTail]= list::reverse(PolyLine),&lt;br /&gt;
        NewCell=ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    makePolyLine(NewCell,_PolyLine)= _PolyLine1:-&lt;br /&gt;
        exception::raise(classInfo,wrongMoveException,[namedValue(&amp;quot;data&amp;quot;,string(toString(NewCell)))]).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    wrongMoveException:exception.&lt;br /&gt;
clauses&lt;br /&gt;
    wrongMoveException&lt;br /&gt;
        (&lt;br /&gt;
        classInfo,&lt;br /&gt;
        predicate_Name(),&lt;br /&gt;
        &amp;quot;The point % can not prolong the polyline!&amp;quot;&lt;br /&gt;
        ).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    ruleLimited_nd(Cell,RestrictingCell)=NewCell:-&lt;br /&gt;
        rule_nd(Cell,NewCell),&lt;br /&gt;
            not(NewCell = RestrictingCell).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    rule_nd(c(X, Y), c(X + 1, Y)):- X &amp;lt; maxColumn_C.&lt;br /&gt;
    rule_nd(c(X, Y), c(X, Y + 1)):- Y &amp;lt; maxrow_C.&lt;br /&gt;
    rule_nd(c(X, Y), c(X - 1, Y)):- X &amp;gt; 1.&lt;br /&gt;
    rule_nd(c(X, Y), c(X, Y - 1)):- Y &amp;gt; 1.&lt;br /&gt;
&lt;br /&gt;
end implement game&lt;br /&gt;
&lt;br /&gt;
/******************************************&lt;br /&gt;
  Interface Player&lt;br /&gt;
  Player in responce to predicate call move()&lt;br /&gt;
  must  reply by calling set(ResponceMove)&lt;br /&gt;
******************************************/&lt;br /&gt;
interface player&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    move:().&lt;br /&gt;
end interface player&lt;br /&gt;
&lt;br /&gt;
/********************************&lt;br /&gt;
  The Class Human&lt;br /&gt;
********************************/&lt;br /&gt;
class human:player&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
end class human&lt;br /&gt;
&lt;br /&gt;
implement human&lt;br /&gt;
open core, exception&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    move():-&lt;br /&gt;
        InputString=humanInterface::getInput(humanInterface::playerMove_S),&lt;br /&gt;
        try&lt;br /&gt;
            game::set(InputString)&lt;br /&gt;
        catch TraceID do&lt;br /&gt;
            handleException(TraceID),&lt;br /&gt;
            fail&lt;br /&gt;
        end try,&lt;br /&gt;
        !.&lt;br /&gt;
    move():-&lt;br /&gt;
        move().&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    handleException:(exception::traceId TraceID).&lt;br /&gt;
clauses&lt;br /&gt;
    handleException(TraceID):-&lt;br /&gt;
        foreach Descriptor=exception::getDescriptor_nd(TraceID) do&lt;br /&gt;
            Descriptor = exception::descriptor(&lt;br /&gt;
                _ClassInfo1,&lt;br /&gt;
                exception::exceptionDescriptor(_ClassInfo2,_PredicateName,Description),&lt;br /&gt;
                _Kind,&lt;br /&gt;
                ExtraInfo,&lt;br /&gt;
                _GMTTime,&lt;br /&gt;
                _ExceptionDescription,&lt;br /&gt;
                _ThreadId),&lt;br /&gt;
            if&lt;br /&gt;
                ExtraInfo=[namedValue(&amp;quot;data&amp;quot;,string(CellPointer))]&lt;br /&gt;
            then&lt;br /&gt;
                ErrorMsg=string::format(Description,CellPointer),&lt;br /&gt;
                humanInterface::announceError(ErrorMsg)&lt;br /&gt;
            else&lt;br /&gt;
                humanInterface::announceError(&amp;quot;&amp;quot;)&lt;br /&gt;
            end if&lt;br /&gt;
        end foreach.&lt;br /&gt;
&lt;br /&gt;
end implement human&lt;br /&gt;
&lt;br /&gt;
/******************************************&lt;br /&gt;
  Class Сomputer&lt;br /&gt;
******************************************/&lt;br /&gt;
class computer:player&lt;br /&gt;
predicates&lt;br /&gt;
    classInfo : core::classInfo.&lt;br /&gt;
end class computer&lt;br /&gt;
&lt;br /&gt;
implement computer&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    className = &amp;quot;Computer&amp;quot;.&lt;br /&gt;
    classVersion = &amp;quot;1.0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    classInfo(className, classVersion).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    move():-&lt;br /&gt;
        Cell=resolveMove(),&lt;br /&gt;
        game::set(toString(Cell)).&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    resolveMove:()-&amp;gt;game::cell.&lt;br /&gt;
clauses&lt;br /&gt;
    resolveMove()=Cell:-&lt;br /&gt;
        Cell=successfulMove(game::polyline_P),&lt;br /&gt;
        !.&lt;br /&gt;
    resolveMove()=Cell:-&lt;br /&gt;
        moveCandidate(game::polyline_P,_PolyLine,Cell),&lt;br /&gt;
        !.&lt;br /&gt;
    resolveMove()=game::c(X+1,Y+1):-&lt;br /&gt;
        X=math::random(game::maxColumn_C-1),&lt;br /&gt;
        Y=math::random(game::maxRow_C-1).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    successfulMove: (game::cell*)-&amp;gt;game::cell nondeterm.&lt;br /&gt;
clauses&lt;br /&gt;
    successfulMove(PolyLine)=Cell:-&lt;br /&gt;
        moveCandidate(PolyLine,_PolyLine1,Cell),&lt;br /&gt;
            list::isMember(Cell, PolyLine),&lt;br /&gt;
            !.&lt;br /&gt;
    successfulMove(PolyLine)=Cell:-&lt;br /&gt;
        moveCandidate(PolyLine, PolyLine1, Cell),&lt;br /&gt;
            not(_=successfulMove(PolyLine1)).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    moveCandidate: (game::cell*,game::cell* [out],game::cell [out]) nondeterm.&lt;br /&gt;
clauses&lt;br /&gt;
    moveCandidate([Cell],[Cell,NewCell], NewCell):-&lt;br /&gt;
        game::rule_nd(Cell, NewCell),&lt;br /&gt;
        !.&lt;br /&gt;
    moveCandidate([Left, RestrictingCell | PolyLine],[NewCell,Left, RestrictingCell| PolyLine], NewCell):-&lt;br /&gt;
        NewCell=game::ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
    moveCandidate(PolyLine,list::reverse([NewCell,Left, RestrictingCell |PolyLineTail]),NewCell):-&lt;br /&gt;
        [Left, RestrictingCell |PolyLineTail] = list::reverse(PolyLine),&lt;br /&gt;
        NewCell=game::ruleLimited_nd(Left,RestrictingCell).&lt;br /&gt;
&lt;br /&gt;
end implement computer&lt;br /&gt;
&lt;br /&gt;
/******************************************&lt;br /&gt;
  Class HumanInterface supports the communication&lt;br /&gt;
  of the human with the computer&lt;br /&gt;
******************************************/&lt;br /&gt;
class humanInterface&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    showStage:().&lt;br /&gt;
    showMove:(game::cell,game::moveType_D).&lt;br /&gt;
    getInput:(inputType_D)-&amp;gt;string InputString.&lt;br /&gt;
&lt;br /&gt;
domains&lt;br /&gt;
    inputType_D=&lt;br /&gt;
        playerMove_S;&lt;br /&gt;
        playerTurn_S.&lt;br /&gt;
&lt;br /&gt;
predicates&lt;br /&gt;
    announceStarter:(string Name).&lt;br /&gt;
    announceMovingPlayer:(string Name).&lt;br /&gt;
    announceWin:(string Name).&lt;br /&gt;
    announceError:(string Description).&lt;br /&gt;
    announceError:().&lt;br /&gt;
&lt;br /&gt;
domains&lt;br /&gt;
    choiceError_D=&lt;br /&gt;
        errorMustBeNumber_S;&lt;br /&gt;
        errorPlayerTurn_S.&lt;br /&gt;
predicates&lt;br /&gt;
    announceChoiceError:(choiceError_D).&lt;br /&gt;
&lt;br /&gt;
end class humanInterface&lt;br /&gt;
&lt;br /&gt;
implement humanInterface&lt;br /&gt;
open core&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    cellMarkedOrdinary_C=&amp;quot;*&amp;quot;.&lt;br /&gt;
    cellMarkedWinner_C=&amp;quot;O&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
constants % messages&lt;br /&gt;
    movingPlayer_C=&amp;quot;% is thinking&amp;quot;.&lt;br /&gt;
    beginner_C=&amp;quot;First move done by: %&amp;quot;.&lt;br /&gt;
    error_C=&amp;quot;Error, % &amp;quot;.&lt;br /&gt;
    congratulation_C=&amp;quot;Player % has won!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    playerMove_C=&amp;quot;Enter the move as  c(X,Y): &amp;quot;.&lt;br /&gt;
    playerTurn_C=&amp;quot;\nWho is moving first (1-human, 2-computer, Enter-exit)?:&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    errorMustBeNumber_C=&amp;quot;\nIt must be numeric! Please repeat the input:&amp;quot;.&lt;br /&gt;
    errorPlayerTurn_C=&amp;quot;\nNo player with this ID! Please repeat the input:&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
constants&lt;br /&gt;
    verticalSpace_C=2.&lt;br /&gt;
    horizontalSpace_C=3.&lt;br /&gt;
    emptyLineLenght_C=80.&lt;br /&gt;
&lt;br /&gt;
constants % Position of Line&lt;br /&gt;
    starterLine_C=1.&lt;br /&gt;
    announceLine_C=starterLine_C+1.&lt;br /&gt;
    actionLine_C=announceLine_C+1.&lt;br /&gt;
    polylineLine_C=actionLine_C+1.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    getInput(InputType)=Input:-&lt;br /&gt;
        inputInvitation(InputType),&lt;br /&gt;
        Input = console::readLine(),&lt;br /&gt;
        console::clearInput().&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    inputInvitation:(inputType_D).&lt;br /&gt;
clauses&lt;br /&gt;
    inputInvitation(playermove_S):-&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(actionLine_C,&amp;quot;%&amp;quot;,playermove_C).&lt;br /&gt;
    inputInvitation(playerTurn_S):-&lt;br /&gt;
        console::clearOutput(),&lt;br /&gt;
        console::write(playerTurn_C).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    showStage():-&lt;br /&gt;
        console::clearOutput(),&lt;br /&gt;
        foreach I = std::fromTo(1, game::maxColumn_C) do&lt;br /&gt;
            console::setLocation(console::location(horizontalSpace_C*I, 0)),&lt;br /&gt;
            console::write(I)&lt;br /&gt;
        end foreach,&lt;br /&gt;
        foreach J = std::fromTo(1, game::maxRow_C) do&lt;br /&gt;
            console::setLocation(console::location(0, verticalSpace_C*J)),&lt;br /&gt;
            console::write(J)&lt;br /&gt;
        end foreach.&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    showMove(game::c(X,Y),_Type):-&lt;br /&gt;
        console::setLocation(console::location(horizontalSpace_C*X, verticalSpace_C*Y)),&lt;br /&gt;
        fail.&lt;br /&gt;
    showMove(_Cell,game::ordinary_S):-&lt;br /&gt;
        console::write(cellMarkedOrdinary_C).&lt;br /&gt;
    showMove(_Cell,game::winner_S):-&lt;br /&gt;
        console::write(cellMarkedWinner_C).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceStarter(Name):-&lt;br /&gt;
        clearMessageArea(starterLine_C),&lt;br /&gt;
        writeMessage(starterLine_C,beginner_C,Name).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceChoiceError(errorMustBeNumber_S):-&lt;br /&gt;
        console::write(errorMustBeNumber_C),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
    announceChoiceError(errorPlayerTurn_S):-&lt;br /&gt;
        console::write(errorPlayerTurn_C),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceError():-&lt;br /&gt;
        announceError(&amp;quot;&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
    announceError(ErrorText):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        writeMessage(announceLine_C,error_C,ErrorText).&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceWin(Name):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        writeMessage(announceLine_C,congratulation_C,Name),&lt;br /&gt;
        showPolyLine(),&lt;br /&gt;
        _ = console::readLine().&lt;br /&gt;
&lt;br /&gt;
clauses&lt;br /&gt;
    announceMovingPlayer(Name):-&lt;br /&gt;
        clearMessageArea(announceLine_C),&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(actionLine_C,movingPlayer_C,Name).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    showPolyLine:().&lt;br /&gt;
clauses&lt;br /&gt;
    showPolyLine():-&lt;br /&gt;
        clearMessageArea(actionLine_C),&lt;br /&gt;
        writeMessage(polylineLine_C,&amp;quot;%&amp;quot;,toString(game::polyline_P)).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    clearMessageArea:(positive AreaID).&lt;br /&gt;
clauses&lt;br /&gt;
    clearMessageArea(AreaID):-&lt;br /&gt;
        console::setLocation(console::location(0,game::maxRow_C*verticalSpace_C+AreaID)),&lt;br /&gt;
        console::write(string::create(emptyLineLenght_C,&amp;quot; &amp;quot;)).&lt;br /&gt;
&lt;br /&gt;
class predicates&lt;br /&gt;
    writeMessage:(positive AreaID,string FormatString,string ParameterString).&lt;br /&gt;
clauses&lt;br /&gt;
    writeMessage(AreaID,FormatString,ParameterString):-&lt;br /&gt;
        console::setLocation(console::location(0, game::maxRow_C*verticalSpace_C+AreaID)),&lt;br /&gt;
        console::writef(FormatString,ParameterString).&lt;br /&gt;
&lt;br /&gt;
end implement humanInterface&lt;br /&gt;
&amp;lt;/vip&amp;gt;&lt;br /&gt;
=References=&lt;br /&gt;
[[ru:Учебный Проект. Релиз 2]]&lt;br /&gt;
[[Category:Tutorial Project Evolutions]]&lt;/div&gt;</summary>
		<author><name>Victor Yukhtenko</name></author>
	</entry>
</feed>