Skip to content

SaadZellag/Chess-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess according to GPT-3

Overview

Chess is a two-player board game played on a checkerboard. Players take turns moving pieces around the board, with the goal of capturing their opponent's king.

There are six different kinds of pieces in chess: pawns, rooks, knights, bishops, the queen, and the king. Pawns are the weakest pieces, and can only move forward one square at a time (except on their first move, when they can move two squares). Rooks can move any number of squares horizontally or vertically. Knights can move in an "L" shape - two squares in one direction, then one more square at a right angle. Bishops can move any number of squares diagonally. The queen is the most powerful piece - she can move any number of squares horizontally, vertically, or diagonally. The king is also powerful, but he has some restrictions: he can only move one square at a time horizontally, vertically, or diagonally. In addition, the king cannot move into check - that is, into a position where he could be captured by the other player's pieces.

The game is won by either capturing the other player's king (checkmate), or trapping the other player's king so that he cannot make any legal moves (stalemate).

Setup

Chess is played on a square board divided into 64 squares arranged in an eight-by-eight grid. The colors of the 64 squares alternate between light and dark (usually green and buff).

Each player begins the game with 16 pieces: 8 pawns, 2 rooks, 2 knights, 2 bishops , 1 queen ,and 1 king . These pieces are referred to as "men". The set-up of the pieces on the board before play is as follows:

The pawns are placed on ranks 2 and 7. Each player puts one pawn in each square of their own rank.

The rooks go in the corners.

The knights go next to the rooks.

The bishops go next to the knights.

The queen goes in the middle square of the back rank, on her own color. (So if you are playing White, your queen will be on a white square; if you are playing Black, your queen will be on a black square.)

The king goes in the remaining middle square.

chess board setup

Rules

The player with the white pieces always moves first. Players then alternate moving one piece at a time (with the exception of castling, as described below). A player can move his or her piece to any open square on the board, with the following exceptions:

Pawns can only move forward one square at a time, except for their very first move where they can move two squares ahead. They can also capture an opponent's piece by moving one square diagonally forward (again, except on their first move where they can move two squares diagonally). Pawns cannot move backwards or sideways - only forwards.

Pieces cannot "jump" over other pieces - they can only move to an open square next to them, or capture an opponent's piece by moving to a diagonal square next to it.

With the exception of pawns and knights, pieces cannot move through other pieces to get to the other side of the board - they can only move when there is an open path to their destination square.

Knights are different from all other pieces because they can "jump" over other pieces - they are not hindered by other pieces being in their way.

A player cannot put his or her own king into check, and cannot move a piece into a position where it would put his or her own king into check. For example: if your opponent has placed his queen directly adjacent to your king (on a diagonal, horizontally, or vertically), you cannot move your king out of check by moving it one space away from her - because that would still leave him in check from her bishop (being adjacent diagonally). In chess notation, this is referred to as being "in check". If a player is in check and has no legal moves he can make to get out of check, that is referred to as "checkmate", and that player loses the game immediately (regardless of whether he has any other pieces left on the board or not). When one player has been checkmated, his opponent is declared the winner!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages