# Chess



## mrfluffy (Jan 1, 2002)

A minor question, in chess the computer can do a move (I think it's called castling) where the king swaps places with the castle, any idea how I can do this?
thanks



I NEED TO WIN!!!


----------



## tagliatelle (Jan 1, 2002)

I have made draugts 4 MacOsx.


----------



## snoozer (Jan 1, 2002)

The King and Rook don't exactly exchange places.  The King moves two squares to its right or left (depending on whether you're castling King-side or Queen-side) and the Rook hops over to the other side of it.

To castle in a chess program, move the King to its destination square.  Since the King normally moves only one square, the computer will know you mean to castle and will move the Rook for you.

There are rules about when you can castle.  Neither the King nor the Rook must have moved.  There must be no pieces on the squares between the King and Rook.  You cannot castle to get out of check.  You cannot castle into check.  You cannot castle if the King would move across a square that would put it in check.  You cannot use castling to capture a piece.

Happy castling,
--Andy


----------



## mrfluffy (Jan 1, 2002)

Thanks, another 3 or 4 months and I might win.


----------

