Difference between revisions of "Tutorial Project. Release 11"

From wiki.visual-prolog.com

m
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{spbCopyright}}
{{PolylineTemplateEn
|goal= Demonstrate the basic approaches of the VIP-based programming:
|goalContent=
*The difference in the traditional Console and object-oriented approach (ObjectConsole and GUI);
*Creation of Vip-based libraries;
*The strong separation of the User Interface and logical part.
|code=
*Release 11 is the set of projects, which has the same game logic organization, but differs by the User Interface type - Соnsole, ObjectConsole, Windows.
*The use of VIP-based libraries.
**Some components are represented as the source code (.PRO) and some represented as libraries (.LIB). Alternative projects presented.
**To build libraries the application '''lib''' (Microsoft Linker Stub 7.10.3077) has been used.
*Logic and UI strongly separated
**In all projects of the Release 11 the code, representing the logic and the code representing the User Interface are strongly separated.
**All Projects of the Release 11 family use the common set of classes, which supports the logic of the game, configuration settings and the game managing.
**Each project uses its own concept of the User Interface. It makes the possibility to create other user interface implementations and to use other UI concepts based say on HTML or XML. It is possible even to use other programming languages to create User Interface.
*'''Universality:''' The structure of the code of the common used logical part gives the possibility to use the logical part with no change to organize the set of similar flat games. The only one JuniourJudge module must be replaced by the module with the same class name and interface and with the new rules support. The new concepts of models of players must be created accordingly.
*'''Known problem:''' The Release 11 set of projects has been grown on the basis of Release 10 project. The interaction between players is organized as the hidden (deeply recursive) process, where the tail recursion demand is not fulfilled. Because of this reason after some value of the multiplication '''board size'''*'''amount of games in the serial games''' the call stack is overloaded and the application disappears. This problem is fixed in the release 12.
|functionality=
{{Polyline11Functionality}}


The programs listed below are part of the [[Tutorial Project Evolutions]] article.
|install=
If you have '''VipSpbSDK''', then you will find all projects in the directory '''Examples\Polyline\Polyline11\Programs'''


[[PolyLine Game Rules|Game Rules ...]]
{{PolylineInstall}}


==Features==
|open=
===user interfaces===
==Building==
Release 11 is the set of projects, which has the same game logic organization, but differs by the User Interface type - Соnsole, ObjectConsole, Windows (the implementation of the Windows-based HumanInterface represented in the library (.lib) in the Personal Edition).
[[Polyline Version Reference|'''Please, see first your version specialty''']]


===the use of VIP-based libraries===
Open and build projects:
Some components are represented same time as the source code (.PRO) and as the libraries (.LIB). Alternative projects presented in the Release 11. The text of the appropriate .CMD file to build libraries also presented.
*Polyline11_Console - console application
*Polyline11_ObjectConsole object-oriented console
*Polyline11_ObjWindows - Windows PFC/GUI
Run the command file Programs\BuildHumanInterfaceLib.cmd
Open and build projects:
*Polyline11_ConsoleLib - the same but the User Interface placed to the library
*Polyline11_ObjectConsoleLib - the same but the User Interface placed to the library
*Polyline11_ObjWindowsLib - Windows PFC/GUI, the User Interface placed to the library


To build libraries the application '''lib''' (Microsoft Linker Stub 7.10.3077) has been used.
{{PolylineBuildCMD}}
 
===logic and UI strongly separated===
In all projects of the Release 11 the code, representing the logic and the code representing the User Interface are strongly separated.
 
All Projects of the Release 11 family use the common set of classes, which supports the logic of the game, configuration settings and the game managing.
The same time each project uses its own concept of the User Interface. It makes the possibility to create other user interface implementations and to use other UI concepts based say on HTML or XML. It is possible even to use other programming languages to create User Interface.
 
===some hints on the universality===
The structure of the code of the common used logical part gives the possibility to use the logical part with no change to organize the set of similar flat games. The only one JuniourJudge module must be replaced by the module with the same class name and interface and with the new rules support.
 
The new models of players must be created accordingly.
 
===the new model of the player added===
The new model of the player Computer3 created. This model is included as the library representation Computer3.lib.
 
This model is not the best, but it is one of possible models. We do not show its source code not because of it contains some Know-How.
 
The librarian representation gives the possibility first to show the competition of two different computer models on the big size boards. The second, it gives the possibility to make pair and group competitions of computer models with the hidden code, created by different people. And here the model Computer3.lib is one of them.
 
==Known problems==
The Release 11 set of projects has been grown on the basis of Release 10 project. The interaction between players is organized as the hidden (deeply recursive) process, where the tail recursion demand is not fulfilled.
 
Because of this reason after some value of the multiplication '''board size'''*'''amount of games in the serial games''' the call stack is overloaded and the application disappears.
 
The fixing of this problem will be the goal of one of the future releases.
 
==Visual Demonstration==
{| cellspacing="0" border="1"
|-
!Picture
!Description
!Details
!Video
 
|-
|[[Image:ConsoleSmall.jpg]]
|LineByLine User Interaction scenario organization. Ordinary Console strategy.
 
Multilingual support.
|No details
|[http://www.prolog-soft.com/Visual-Prolog/Downloads/consoleMovie.zip Download and see Movie... (Zip archive 640 Kb)]
 
|-
|[[Image:ObjectConsoleSmall.jpg]]
|Object-oriented Console. Based on interface components like PushButton, EditConrol etc., mouse based handling User-centered interaction.
Built on the PFC/Console. The concept is similar to PFC/GUI, including the event driven organization.
 
No multilingual support.
|[[Game Polyline. Release 11 ObjectConsole|More Details ...]]
|[http://www.prolog-soft.com/Visual-Prolog/Downloads/ObjectConsoleMovie.zip Download and see Movie... (Zip archive 2.33 Mb)]
 
|-
|[[Image:ObjectWinSmall.jpg]]
|Windows-based User Interface. PFC/GUI concept used.
 
No multilingual support.
|No details
|[http://www.prolog-soft.com/Visual-Prolog/Downloads/ObjectWinMovie.zip Download and see Movie... (Zip archive 2.9 Mb)]
 
|}
 
==Download and Install==
To install and run the set of projects of the Release 11:
*Download archives
**'''SpbVipSDK_73_PE_Examples_Polyline11_Classes.zip'''
**'''SpbVipSDK_73_PE_Examples_Polyline11_Programs.zip''',
 
using the PDC forum page [http://discuss.visual-prolog.com/viewtopic.php?p=31221#31221 VIP-Tools and Examples]
*Extract archives listed above to the same directory. You should have in mind, that each of the archives creates the structure of the folders with the root PdcSpbSDK. Repetitions are possible. The result the structure of the Release 11 should look like:
 
[[Image:Polyline11Structure.jpg]]
 
*Open, build and run (using '''VIP 7.3'''):
**Polyline11_Console - console
**Polyline11_ConsoleLib - the same but the User Interface placed to the library
**Polyline11_ObjectConsole object-oriented console
**Polyline11_ObjectConsoleLib - the same but the User Interface placed to the library
**Polyline11_ObjWindowsLib - Windows PFC/GUI, the User Interface placed to the library
 
As before to build projects of the Polyline11 release the IDE variable SpbSolutions must be set to the PdcSpbSDK directory.
 
==Run==
The language of the application, if supported, may be defined in the command line by the language identifier:
*en - English
*ru - Russian


|run=
{{PolylineRun7_X}}
|rusver=
[[ru:Учебный Проект. Релиз 11]]
[[ru:Учебный Проект. Релиз 11]]
[[Category:Tutorial Project Evolutions]]
}}

Latest revision as of 14:48, 8 April 2011

Written by Victor Yukhtenko. Email: victor@pdc.spb.su

The programs listed below are part of the Evolutions Tutorial Project article.

Game Rules ...

Goal

Demonstrate the basic approaches of the VIP-based programming:

  • The difference in the traditional Console and object-oriented approach (ObjectConsole and GUI);
  • Creation of Vip-based libraries;
  • The strong separation of the User Interface and logical part.

Functionality

Picture Description Details Video
ConsoleSmall.jpg LineByLine User Interaction scenario organization. Ordinary Console strategy.

Multilingual support.

No details Download and see Movie... (Zip archive 640 Kb)
ObjectConsoleSmall.jpg Object-oriented Console. Based on interface components like PushButton, EditConrol etc., mouse based handling User-centered interaction.

Built on the PFC/Console. The concept is similar to PFC/GUI, including the event driven organization.

No multilingual support.

More Details ... Download and see Movie... (Zip archive 2.33 Mb)
ObjectWinSmall.jpg Windows-based User Interface. PFC/GUI concept used.

No multilingual support.

No details Download and see Movie... (Zip archive 2.9 Mb)

Known problem

After some value of the multiplication board size*amount of games in the serial games the application disappears. The reason is explained in the ‘’’Code’’’.

This problem is fixed in the release 12.

Code

  • Tested with Visual Prolog 7.3 build 7302.
  • Release 11 is the set of projects, which has the same game logic organization, but differs by the User Interface type - Соnsole, ObjectConsole, Windows.
  • The use of VIP-based libraries.
    • Some components are represented as the source code (.PRO) and some represented as libraries (.LIB). Alternative projects presented.
    • To build libraries the application lib (Microsoft Linker Stub 7.10.3077) has been used.
  • Logic and UI strongly separated
    • In all projects of the Release 11 the code, representing the logic and the code representing the User Interface are strongly separated.
    • All Projects of the Release 11 family use the common set of classes, which supports the logic of the game, configuration settings and the game managing.
    • Each project uses its own concept of the User Interface. It makes the possibility to create other user interface implementations and to use other UI concepts based say on HTML or XML. It is possible even to use other programming languages to create User Interface.
  • Universality: The structure of the code of the common used logical part gives the possibility to use the logical part with no change to organize the set of similar flat games. The only one JuniourJudge module must be replaced by the module with the same class name and interface and with the new rules support. The new concepts of models of players must be created accordingly.
  • Known problem: The Release 11 set of projects has been grown on the basis of Release 10 project. The interaction between players is organized as the hidden (deeply recursive) process, where the tail recursion demand is not fulfilled. Because of this reason after some value of the multiplication board size*amount of games in the serial games the call stack is overloaded and the application disappears. This problem is fixed in the release 12.

Install

If you have VipSpbSDK, then you will find all projects in the directory Examples\Polyline\Polyline11\Programs

To get the full set of projects of the series of the Polyline projects, please download archives using links at PDC forum:

  • VipSpbSDK_PE_73_Examples_Polyline_1_14.zip
  • VipSpbSDK_PE_73_Tools_Polyline_1_14.zip]

to any convenient directory. The directory named VipSpbSDK will be created automatically.

Building

Please, see first your version specialty

Open and build projects:

  • Polyline11_Console - console application
  • Polyline11_ObjectConsole object-oriented console
  • Polyline11_ObjWindows - Windows PFC/GUI

Run the command file Programs\BuildHumanInterfaceLib.cmd Open and build projects:

  • Polyline11_ConsoleLib - the same but the User Interface placed to the library
  • Polyline11_ObjectConsoleLib - the same but the User Interface placed to the library
  • Polyline11_ObjWindowsLib - Windows PFC/GUI, the User Interface placed to the library

To build projects the IDE variable SpbSolutions must be set to the VipSpbSDK directory.

The complex building

To simplify the settings and initial building of applicaions the Build.cmd command file included (BuildPersonal.cmd - please see details in Polyline Version Reference or in Examples\Polyline\VersionReference.html).

The use of Build.cmd file:

  • sets the SpbSolutions IDE variable, which refers to the VipSpb SDK directory;
  • "knows" where Visual Prolog is installed and uses VipBuilder.exe;
  • builds all projects containing in the subfolders;
  • builds all needed libraries;
  • registers all pzl-Components (if needed);
  • informs regarding the result of each building operation;
  • Build.cmd file may be used together with the Visual Prolog CE only (please see details in Polyline Version Reference or in Examples\Polyline\VersionReference.html).

Run

  • Run the application using the E of the IDE or run the executable at the directory EXE.
  • The language of the application may be defined in the command line by the language identifier:
    • en - English
    • ru - Russian
  • When running the program from the IDE, the parameter of the language must be placed to the field "Project Settings"\Run Options\Run Arguments, available from menu Project\Settings...