Skip to content

amchi1205/Chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Chess Game with Fairy Pieces

The starting position for the game is the normal starting position for standard chess. Tracks which player's turn it is. As in standard chess, white moves first. Pieces move and capture the same as in standard chess, except that there is no check or checkmate, and there is no castling, en passant, or pawn promotion. As in standard chess, each pawn should be able to move two spaces forward on its first move (but not on subsequent moves).

If a player's king is captured, the game ends, and that player loses.

Locations on the board will be specified using "algebraic notation", with columns labeled a-h and rows labeled 1-8, as shown in this diagram:

board

Special rules for this variant of chess:

Each of the players in the reserve has one piece of the Falcon and the Hunter.

Falcon: moves forward like a bishop, and backward like a rook

Hunter: moves forward like a rook and backward like a bishop

The falcon and hunter start the game off the board and out of play (see diagram). Once a player loses their queen, a rook, a bishop, or a knight, they may, on any subsequent move, enter their falcon or hunter into play on any empty square of their two home ranks. Doing so constitutes a turn. The player becomes eligible to enter their remaining fairy piece (falcon or hunter) after losing a second piece (queen, rook, bishop, or knight)(could be anytime after losing the first piece, don’t need to be losing after entering the first fairy piece). https://www.chess.com/blog/Pokshtya/falcon-hunter-chess https://en.wikipedia.org/wiki/Falcon%E2%80%93hunter_chess

ChessVar class includes the following:

An init method that initializes any data members
A method called get_game_state that just returns 'UNFINISHED', 'WHITE_WON', 'BLACK_WON'.
A method called make_move that takes two parameters - strings that represent the square moved from and the square moved to. For example, make_move('b2', 'b4'). If the square being moved from does not contain a piece belonging to the player whose turn it is, or if the indicated move is not legal, or if the game has already been won, then it should just return False. 
Otherwise it should make the indicated move, remove any captured piece, update the game state if necessary, update whose turn it is, and return True.
A method called enter_fairy_piece that takes two parameters - strings that represent the type of the piece (white falcon 'F', white hunter 'H', black falcon 'f', black hunter 'h') and the square it will enter. For example, enter_fairy_piece ('H', 'c1'). 
If the fairy piece is not allowed to enter this position at this turn for any reason, it should just return False. Otherwise it should enter the board at that position, update whose turn it is, and return True.

Here's a very simple example of how the class could be used:

game = ChessVar()
move_result = game.make_move('c2', 'c4')
game.make_move('g7', 'g5')
state = game.get_game_state()

About

Chess

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages