Paste: bad macro input

Author: kobi
Mode: factor
Date: Mon, 19 Apr 2010 06:30:27
Plain Text |

TUPLE: position
    { x integer } { y integer } ;

TUPLE: chess-position < position
    { piece piece initial: f } ;

: [+|-] ( step ? -- [step+/-] )
    [ + ] [ - ] ? curry ;

! direction words are based on the player's view, changing structures is based on absolute board view.

: right ( chess-position n -- chess-position ) 
    over white?      [+|-] change-x ; ! white is plus, black is minus

: left  ( position n -- position ) 
    over white? not  [+|-] change-x ; ! black is plus, white is minus

! ...

Annotation: fix:

Author: kobi
Mode: factor
Date: Mon, 19 Apr 2010 07:32:33
Plain Text |
: [+|-] ( step ? -- [step+/-] )
    [ + ] [ - ] ? curry [ call( x -- x' ) ] curry ; inline

New Annotation

Summary:
Author:
Mode:
Body: