Code covered by the BSD License  

Highlights from
Chess with "Greedy Edi"

image thumbnail

Chess with "Greedy Edi"

by

 

07 Nov 2009 (Updated )

Play chess against "Greedy Edi".

stopCursor

stopCursor

stopCursor Stops the cursor from moving and proceeds with the chess game.

Contents

Syntax

stopCursor(varargin)

Description

The cursors motion is stopped and the game logic is executed.

This function is called from the Mouse Button Up Callback, and causes the mouse to stop moving. It checks whether the move (currently stored in the cursor) is legal. If it is legal the half-move is executed, otherwise the cursor color is set to red, indicating that it was illegal. If the half-move was legal, EDI moves. All moves are recorded here. Also the decision of who won the game is made. Hence, this function is one of the central control parts of the chess program.

Input and *Output:*

  • global board ... chess board and related information
  • global history ... game history
  • global game ... status of the game
  • varargin ... currently not used

Example

Stops a moving cursor and executes the move (stored in the cursor structure). stopCursor

See also

cursorListener, setCursor, reset_cursor

Signature

  • Copyright 2006 W.Garn

Contact us