Chess Game Example

From WeizmannWiki
Revision as of 08:08, 4 March 2013 by Michal (Talk | contribs)

Jump to: navigation, search

This is a protected page for the Chess Game Example.

The ChessGameExample demonstrate chess game with a two-player strategy played on a chessboard. The original chess game has lots of rules and regulations most of them are implemented in this example.The game accepts moves through the mouse click on the pieces. A source selection highlights valid user moves for target selection. The game can be constructed in different ways, in which two of them are described below.

Game Board

ChessScreenShot.png


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. 
LSC
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.
LSC
Square RemovePiece When the square Sq1 move_Piece to square Sq2,  then the square Sq2 emptyPiece the square Sq2.
LSC
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".
LSC
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".  
LSC
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".
LSC
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".
LSC
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.
LSC


Graph and Connections

Example of a not working LSC


Name Explanation LSC
Square ResetHighlight 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 
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". 
LSC
ChessNL SelectTarget when the user clicks any Square, if the board sourcetargetValue is "1" then the Square selectTarget and the board sourcetargetValue changes to "0". 
LSC
ChessNL CheckPossibility when any Square selectTarget then the Square checkPossibility.  
LSC
ChessNL MovePiece when any Square checkPossibility, if the Square possibility is "true" then the Square MovePiece.  
LSC
ChessNL TurnChange when any Square MovePiece, if the board state is "black" then the board state changes to "white" otherwise if the board state is "white" then the board state changes to "black" .  
LSC
ChessNL WrongTurn when any Square selectSource, if the Square type is "black" and the board state is "white" then the Square showMessage.  
LSC
ChessNL WrongTurn2 when any Square selectSource, if the Square type is "white" and the board state is "black" then the Square showMessage.  
LSC
ChessNL ResetBoard when any Square showMessage then the board sourcetargetValue changes to "0".  
LSC
ChessNL PawnPossiblePosition when any Square selectSource, if the Square piecename is "pawn" then the Square setPossiblePawnSquares.  
LSC
ChessNL RookPossiblePosition when any Square selectSource, if the Square piecename is "rook" then the Square setPossibleRookSquares .  
LSC
ChessNL KnightPossiblePosition when any Square selectSource, if the Square piecename is "knight" then the Square setPossibleKnightSquares.  
LSC
ChessNL BishopPossiblePosition when any Square selectSource, if the Square piecename is "bishop" then the Square setPossibleBishopSquares.  
LSC
ChessNL QueenPossiblePosition when any Square selectSource, if the Square piecename is "queen" then the Square setPossibleQueenSquares .  
LSC
ChessNL KingPossiblePosition when any Square selectSource, if the Square piecename is "king" then the Square setPossibleKingSquares .  
LSC



Graph and Connections