Difference between revisions of "Chess Game Example"
From WeizmannWiki
Line 1: | Line 1: | ||
− | This is a protected page for the Chess Game Example. | + | This is a protected page for the Chess Game Example. |
− | <br> | + | <br> |
== Chess Game Example<br> == | == Chess Game Example<br> == | ||
− | The ChessGameExample is the chess game which can be played between two user, the black and white.The chess game is implemented with some of the rules and restictions of the original chess game. | + | The ChessGameExample is the chess game which can be played between two user, the black and white.The chess game is implemented with some of the rules and restictions of the original chess game. |
== Game Board == | == Game Board == | ||
− | [[Image:ChessScreenShot.png]] | + | [[Image:ChessScreenShot.png]] |
− | <br> | + | <br> |
== Example 1 - LSC for the game == | == Example 1 - LSC for the game == | ||
− | <br><br> | + | <br><br> |
{| width="100%" border="1" align="left" cellpadding="1" cellspacing="1" | {| width="100%" border="1" align="left" cellpadding="1" cellspacing="1" | ||
|- | |- | ||
− | ! scope="col" width="15%" | Name | + | ! scope="col" width="15%" | Name |
− | ! scope="col" width="70%" | Description | + | ! scope="col" width="70%" | Description |
! scope="col" width="15%" | LSC | ! scope="col" width="15%" | LSC | ||
|- | |- | ||
− | | Square PieceClick | + | | Square PieceClick |
− | | When the user click any square Sq1, and then click any square Sq2, if the board next turn is equals to the Sq1 piece type then the square Sq1 check_Move square Sq2. | + | | When the user click any square Sq1, and then click any square Sq2, if the board next turn is equals to the Sq1 piece type then the square Sq1 check_Move square Sq2. |
− | | | + | | |
− | [[Image:PieceClick.png|thumb|left|LSC]] | + | [[Image:PieceClick.png|thumb|left|LSC]] |
|- | |- | ||
− | | Square MovePiece | + | | Square MovePiece |
− | | When the square Sq1 check_Move square Sq2, canmove is assigned whether the movement of piece from square Sq1 to Sq2 is possible, if the piece canmove and Sq1 piecetype is not equals to Sq2 piecetype then the square Sq1 move_Piece to square Sq2. | + | | When the square Sq1 check_Move square Sq2, canmove is assigned whether the movement of piece from square Sq1 to Sq2 is possible, if the piece canmove and Sq1 piecetype is not equals to Sq2 piecetype then the square Sq1 move_Piece to square Sq2. |
| [[Image:MovePiece.png|thumb|left|LSC]] | | [[Image:MovePiece.png|thumb|left|LSC]] | ||
|- | |- | ||
− | | Square RemovePiece | + | | Square RemovePiece |
− | | When the square Sq1 move_Piece to square Sq2, then the square Sq2 emptyPiece the square Sq2. | + | | When the square Sq1 move_Piece to square Sq2, then the square Sq2 emptyPiece the square Sq2. |
| [[Image:RemovePiece.png|thumb|left|LSC]] | | [[Image:RemovePiece.png|thumb|left|LSC]] | ||
|- | |- | ||
− | | Square NextMove | + | | Square NextMove |
− | | When the square Sq1 move_Piece to square Sq2, if the board next turn is "white" the board next turn changes to "black" otherwise if the board next turn is "black" the board next turn changes to "white". | + | | When the square Sq1 move_Piece to square Sq2, if the board next turn is "white" the board next turn changes to "black" otherwise if the board next turn is "black" the board next turn changes to "white". |
| [[Image:NextMove.png|thumb|left|LSC]] | | [[Image:NextMove.png|thumb|left|LSC]] | ||
|- | |- | ||
− | | Square SetSource | + | | Square SetSource |
− | | When the user click any square Sq1, if the Issource is "empty" then the square Sq1's possible positions are set and the IsSource changes to "set". | + | | When the user click any square Sq1, if the Issource is "empty" then the square Sq1's possible positions are set and the IsSource changes to "set". |
| [[Image:SetSource.png|thumb|left|LSC]] | | [[Image:SetSource.png|thumb|left|LSC]] | ||
|- | |- | ||
− | | Square ShowMessage | + | | Square ShowMessage |
− | | When the user click any square Sq1, if the square IsSource is "empty" and the board next turn not equals the Sq1 piecetype then the square showmessage and the Issource is set to "empty". | + | | When the user click any square Sq1, if the square IsSource is "empty" and the board next turn not equals the Sq1 piecetype then the square showmessage and the Issource is set to "empty". |
| [[Image:ShowMessage.png|thumb|left|LSC]] | | [[Image:ShowMessage.png|thumb|left|LSC]] | ||
|- | |- | ||
− | | Square ShowMessageReset | + | | Square ShowMessageReset |
− | | When the user click any square Sq1, if the square IsSource is "empty" and the board next turn not equals the Sq1 piecetype then the square showmessage and the Issource is set to "empty". | + | | When the user click any square Sq1, if the square IsSource is "empty" and the board next turn not equals the Sq1 piecetype then the square showmessage and the Issource is set to "empty". |
| [[Image:ShowmessageReset.jpg|thumb|left|LSC]] | | [[Image:ShowmessageReset.jpg|thumb|left|LSC]] | ||
|- | |- | ||
− | | Square ResetPossiblePosition | + | | Square ResetPossiblePosition |
− | | When the user click any square Sq1, the square Sq1 setPossiblePosition and the user click any other square Sq2 then the Sq2 resetPossiblePosition of the Sq1. | + | | When the user click any square Sq1, the square Sq1 setPossiblePosition and the user click any other square Sq2 then the Sq2 resetPossiblePosition of the Sq1. |
| [[Image:ResetPossiblePosition.png|thumb|left|LSC]] | | [[Image:ResetPossiblePosition.png|thumb|left|LSC]] | ||
|} | |} | ||
− | <br> | + | <br> |
== Graph and Connections<br> == | == Graph and Connections<br> == | ||
Line 64: | Line 64: | ||
===== Example of a not working LSC ===== | ===== Example of a not working LSC ===== | ||
− | <br> | + | <br> |
{| width="100%" border="1" align="left" cellpadding="1" cellspacing="1" | {| width="100%" border="1" align="left" cellpadding="1" cellspacing="1" | ||
|- | |- | ||
− | ! scope="col" width="10%" | Name | + | ! scope="col" width="10%" | Name |
− | ! scope="col" width="50%" | LSC | + | ! scope="col" width="50%" | LSC |
! scope="col" width="40%" | Explanation | ! scope="col" width="40%" | Explanation | ||
|- | |- | ||
− | | Square ResetHighlight | + | | Square ResetHighlight |
− | | [[Image:ResetHighlight.png|LSC]] | + | | [[Image:ResetHighlight.png|LSC]] |
− | | | + | | |
− | when the square sq2 is highlighed and the user click that square Sq2 then the square reset the highlight. Since the Sq2 is dynamic and there are more highlighted squares it leads to the universal binding. The | + | when the square sq2 is highlighed and the user click that square Sq2 then the square reset the highlight. Since the Sq2 is dynamic and there are more highlighted squares it leads to the universal binding. The |
|} | |} | ||
− | <br> | + | <br> |
== Example-2 LSCs with Natural Language == | == Example-2 LSCs with Natural Language == | ||
Line 85: | Line 85: | ||
{| width="100%" border="1" align="left" cellpadding="1" cellspacing="1" | {| width="100%" border="1" align="left" cellpadding="1" cellspacing="1" | ||
|- | |- | ||
− | ! scope="col" width="15%" | Name | + | ! scope="col" width="15%" | Name |
− | ! scope="col" width="70%" | Natural Language Text | + | ! scope="col" width="70%" | Natural Language Text |
! scope="col" width="15%" | LSC | ! scope="col" width="15%" | LSC | ||
|- | |- | ||
− | | | + | | ChessNL SelectSource |
− | | | + | | when the user clicks any Square, if the board sourcetargetValue is "0" and the Square type is not "vacent" then the Square selectSource and the board sourcetargetValue changes to "1" Sq2. |
− | | | + | | |
− | [[Image: | + | [[Image:SelectSource.png|thumb|left|LSC]] |
− | + | ||
|- | |- |
Revision as of 10:09, 28 February 2013
This is a protected page for the Chess Game Example.
Contents
Chess Game Example
The ChessGameExample is the chess game which can be played between two user, the black and white.The chess game is implemented with some of the rules and restictions of the original chess game.
Game Board
Example 1 - LSC for the game
Name | Description | LSC |
---|---|---|
Square PieceClick | When the user click any square Sq1, and then click any square Sq2, if the board next turn is equals to the Sq1 piece type then the square Sq1 check_Move square Sq2. | |
Square MovePiece | When the square Sq1 check_Move square Sq2, canmove is assigned whether the movement of piece from square Sq1 to Sq2 is possible, if the piece canmove and Sq1 piecetype is not equals to Sq2 piecetype then the square Sq1 move_Piece to square Sq2. | |
Square RemovePiece | When the square Sq1 move_Piece to square Sq2, then the square Sq2 emptyPiece the square Sq2. | |
Square NextMove | When the square Sq1 move_Piece to square Sq2, if the board next turn is "white" the board next turn changes to "black" otherwise if the board next turn is "black" the board next turn changes to "white". | |
Square SetSource | When the user click any square Sq1, if the Issource is "empty" then the square Sq1's possible positions are set and the IsSource changes to "set". | |
Square ShowMessage | When the user click any square Sq1, if the square IsSource is "empty" and the board next turn not equals the Sq1 piecetype then the square showmessage and the Issource is set to "empty". | |
Square ShowMessageReset | When the user click any square Sq1, if the square IsSource is "empty" and the board next turn not equals the Sq1 piecetype then the square showmessage and the Issource is set to "empty". | |
Square ResetPossiblePosition | When the user click any square Sq1, the square Sq1 setPossiblePosition and the user click any other square Sq2 then the Sq2 resetPossiblePosition of the Sq1. |
Graph and Connections
Example of a not working LSC
Example-2 LSCs with Natural Language
Name | Natural Language Text | LSC |
---|---|---|
ChessNL SelectSource | when the user clicks any Square, if the board sourcetargetValue is "0" and the Square type is not "vacent" then the Square selectSource and the board sourcetargetValue changes to "1" Sq2. |