PROJECT REPORT On Chess Development
PROJECT REPORT On Chess Development
` PROJECT REPORT
Submitted To:
AKS University, Satna
IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE
BACHELORS OF THE COMPUTER APPLICATION OF
COMPUTER SCIENCE AND ENGINEERING by
Aditya Shukla(B21555R10195014)
Aakash Biswas(B2155R10195033)
Introduction :
Chess, one of the oldest and most popular board games, played by two opponents
on a checkered board with specially designed pieces of contrasting colours,
commonly white and black. White moves first, after which the players alternate
turns in accordance with fixed rules, each player attempting to force the opponent’s
principal piece, the King, into checkmate—a position where it is unable to avoid
capture.
Chess first appeared in India about the 6th century AD and by the 10th century had
spread from Asia to the Middle East and Europe. Since at least the 15th century,
chess has been known as the “royal game” because of its popularity among the
nobility. Rules and set design slowly evolved until both reached today’s standard
in the early 19th century. Once an intellectual diversion favoured by the upper
classes, chess went through an explosive growth in interest during the 20th century
as professional and state-sponsored players competed for an officially recognized
world championship title and increasingly lucrative tournament prizes. Organized
chess tournaments, postal correspondence games, and Internet chess now attract
men, women, and children around the world.
Chess is played on a board of 64 squares arranged in eight vertical rows called files
and eight horizontal rows called ranks. These squares alternate between two
colours: one light, such as white, beige, or yellow; and the other dark, such as black
or green. The board is set between the two opponents so that each player has a
light-coloured square at the right-hand corner.
During the game, the two opponents take turns to move one of their pieces to a
different square of the board. One player ('White') has pieces of a light colour; the
other player ('Black') has pieces of a dark colour. There are rules about how pieces
move, and about taking the opponent's pieces off the board. The player with white
pieces always makes the first move. Because of this, White has a small advantage,
and wins more often than Black in tournament games.
History :
Most historians agree that the game of chess was first played in
northern India during the Gupta Empire in the 6th century AD. This early type of
chess was known as Chaturanga, a Sanskrit word for the military. The Gupta
chess pieces were divided, like their military, into
the infantry, cavalry, elephants, and chariots. Over time, these pieces became the
pawn, knight, bishop, and rook. The English words chess and check both come
from the Persian word shah meaning king.
The earliest written evidence of chess is found in three romances (epic stories)
written in Sassanid Persia around 600AD. The game was known as chat
rang or Shatranj. When Persia was taken over by Muslims (633–644) the game
spread to all parts of the Muslim world. Muslim traders carried the game
to Russia and Western Europe. By the year 1000, it had spread all across Europe.
In the 13th century, a Spanish manuscript called Libro de los Ju egos described
the games of Shatranj (chess), backgammon, and dice.
The game changed greatly between about 1470 to 1495. The rules of the older
game were changed in the West so that some pieces (queen, bishop) had more
scope, piece development was faster, and the game was more exciting. The new
game formed the basis of modern international chess. Chess historians consider
this to be the most important change since the game's invention.
Rules:
The Rules of Chess are governed by the world chess federation which is known by
The Initials FIDE meaning federation Internationale des Échecs. The rules are in
the section Laws of Chess of the FIDE Handbook. FIDE also give rules and
guidelines for chess tournaments.
Setup:
Chess is played on a square board divided into eight rows of squares
called ranks and eight columns called files, with a dark square in each player's
lower left corner. There are 64 squares on a chess board. The colours of the squares
are laid out in a checker (chequer) pattern with light and dark squares. To make
speaking and writing about chess easy, each square has a name. Rank are numbered
from 1 to 8, and each file is lettered from a to h. The letter assigned to a file comes
before the number.
its ownable, such as g1 or f5. The pieces are in white and black sets. The players
are called White and Black, and at the start of a game each player has 16 pieces.
The 16 pieces are one king, one queen, two rooks, two bishops, two knights and
eight pawns.
Movements:
Definitions: vertical lines are files; horizontal lines are ranks; lines at 45°
are diagonals. Each piece has its own way of moving around the board.
The X marks the squares where the piece can move.
• The knight is the only piece that can jump over another piece.
• No piece may move to a square occupied by a piece of the same colour.
• All pieces capture the same way they move, except pawns.
• The king (K for short) can move one square in any direction. The king
may not move to any square where it is threatened by an opposing piece.
However, the king can move to a square that is occupied by an
opponent's piece and capture the piece, taking it off the board.
• The queen (Q) can move any distance in any direction on the ranks, files
and diagonals.
• The rooks (R) move any distance on the ranks or files
• The bishops (B) move diagonally on the board. Since a bishop can only
move diagonally, it will always be on the same colour square.
• The knights (Kt or N) move in an "L" shape. Each move must be either
two squares along a rank and one square along a file, or two squares
along a file and one square along a rank. It is the only piece that can
jump over other pieces. Like the other pieces, it captures an opposing
piece by landing on its square.
• The pawns can only move up the board. On its first move a pawn may
move either one or two squares forward. A pawn captures one square
diagonally, not as it moves: see white circles on its diagram. In some
situations, pawns can capture opponent's pawns in a special way
called en passant, which means in passing in French (see below).
Capturing:
Most pieces capture as they move. If a piece lands on an opponent's piece, the
opposing piece is taken off the board. There are three special cases:
Special moves:
Castling-:
Once in every game, each king can make a special move, known as castling.
When the king castles, it moves two squares to the left or right. When this
happens, the rook is moved to stand on the opposite side of the King. Castling is
only allowed if all of these rules are kept:
• Neither piece doing the castling may have been moved during the game.
• There must be no pieces between the squares the king and the rook.
• The king may not be currently in check. The king can't pass through any
square attacked by the opponent as well. As with any move, castling is
not allowed if it would place the king in check.[4]
En passant-:
En passant ('in passing' in French) is a special capture. It is only available when a
pawn moves forward two squares past an opposing pawn on an adjacent file. The
opposing pawn must be on the 5th rank from its own side. Then the opponent's
pawn can capture the double-mover as if it had only moved one square forward.
This option is open on the next move only.
For example, if the black pawn has just moved up two squares from g7 to g5,
then the white pawn on f5 can take it by en passant on g6. The en passant rule
was developed when pawns were allowed to make their double move. The rule
made it more difficult for players to avoid pawn exchanges and blockade the
position. It kept the game more open.
Promotion-:
When a pawn moves to its eighth rank, it must be changed for a piece: a queen,
rook, bishop, or knight of the same colour (player's choice). Normally, the pawn
is queened, but in some cases another piece is chosen to get an advantage. This is
called 'under-promotion'.
Wins-:
Draws-:
• Draw agreed. A game may end in a draw at any time if one player
offers a draw and the other accepts.
• Insufficient material or dead position. A position where no series of
legal moves could lead to a mate (example: K+B vs K). The game is
drawn.
• Stalemate. If a player cannot make a move, and the player's king is not
in check, this is also a draw. This kind of draw is called a stalemate, and
is rare.
• 50-move rule. A game will also end in a draw if no piece is captured
and no pawn has moved after fifty moves. This is called the fifty-move
rule, and happens late in the game.
• Threefold repetition. If the exactly same position is repeated three
times during a game with the same player to move each time, the player
next to move may claim a draw. The game is now drawn. This is called
a draw by threefold repetition.
Competition rules-:
The FIDE rules for competitive chess include all the rules above, as well as
several others.
Chess clocks-:
Competitive games of chess must be played with special chess clocks which time
a player only when it is their turn to move. After moving, the player presses a
button on the clock, which stops the player's clock and starts the opponent's
clock. Usually the clocks are mechanical, but some are electronic. Electronic
clocks can be set to various programs, and they can count moves made.
Stages of a game
A game is divided into three stages: the opening, the middlegame, and the
endgame.
Opening-:
The first moves of a chess game are called the opening.[26][27] A chess
opening is a name given to a series of opening moves. Recognized
patterns of opening moves are openings and have been given names
such as the Ruy Lopez or Sicilian defence. They are listed in reference
works such as the Encyclopaedia of Chess Openings. There
are dozens of different openings. They range from gambits, where
material, such as pawns are offered for fast development (e.g. the King's
Gambit), to slower openings, which lead to a manoeuvring type of game
(e.g. the Réti opening). In some opening lines, the sequence thought best
for both sides has been worked out to 20–30 moves; most players avoid
such lines.[28] Expert players study openings throughout their chess
career, as opening theory keeps on developing.
The basic aims of the opening phase are:
Middlegame-:
The middlegame is the part of the game where most pieces have been developed.
It is where most games are won and lost. Many games will end in resignation
before the endgame takes place.
A middlegame position has a structure. That structure is determined by the
opening. The simplest way to learn the middlegame is to select an opening and
learn it well (see examples in English Opening and French Defence).
These are some things to look for when analysing a middlegame position:
Endgame-:
The endgame is the part of the game when there are few pieces left on the board.
There are three main strategic differences between earlier parts of the game and
the endgame:
Chess engines-:
Chess engines are computer systems that can play chess games against human
opponents. Quite a number have been devised; they can play at master level,
though their processes are quite different from a human being.[9]p87
Every year brings new advances, which if listed here would soon be out of date.
Best advice is to go to English Wikipedia, which keeps an up-to-date chart of the
leading software:
Chess databases-:
Chess databases give access to the recorded history of master chess
games. There are two components: software, which lets one search and
organise the database material, and the actual database. There are
usually over a million games in a given database.
In practice, databases are used for two purposes. First, for a player to
train his/her ability at specific openings. Second, to look up specific
opponents to see what they play, and prepare against them beforehand.
The existence of chess databases is one of the reasons players can
achieve mastery at an young age.
ChessBase-:
New in Chess
This is a Dutch magazine for advanced players, which runs an online database
called NicBase as part of its services. NicBase is free, and has over a million
games.
Chess games
Chessgames.com runs an online database of games. It is mostly free; full access
to all its facilities costs a subscription. It has over half a million games on its
database.
pre-1700 :
• 1475: Francesc de Castellví vs. Narcís de Vinyoles, Valencia 1475. The
first documented chess game played with the modern queen and bishop
moves; the moves were described in the poem Scachs d'amor.
• 1623: Greco–NN, London 1623. Gioachino Greco mates on the eighth
move with a queen sacrifice.
18th century :
• 1788: Thomas Bowdler vs Henry Seymour Conway, London. Thomas
Bowdler offers the first example of a famous double rook sacrifice.
• 1790: Andrew Smith vs François André Philidor, London. François-
André Danican Philidor, who was quoted as saying "Pawns are the soul
of chess", demonstrates the power of a superior pawn formation.
19th century :
• 1834: Louis Charles Mahe De La Bourdonnais vs Alexander
McDonnell, 50th Match Game, London. Reuben Fine in The World's
Great Chess Games describes it as the first great immortal game of
chess. Alexander McDonnell sacrifices his queen for two minor pieces.
• 1834: La Bourdonnais–McDonnell, 62nd Match Game, London.
Perhaps the most famous win of the match (considered an
unofficial world championship), Louis La Bourdonnais shows how a
rolling pawn mass can overwhelm all of his opponent's major pieces,
winning thereby against Alexander McDonnell.
• 1843: Pierre de Saint Amant vs Howard Staunton, 5th Match Game,
Paris. Pierre Charles Fournier de Saint-Amant resigns in this unofficial
world championship match game with Howard Staunton, in which
Staunton remarked, "The latter portion of this game is conducted with
remarkable skill by both parties."
• 1844: Alexander Hoffmann vs Alexander Petrov, Warsaw. Alexander
Petrov wins with a queen sacrifice and a king hunt, in a game known as
"Petrov's Immortal", against Alexander Hoffmann.
• 1851: Adolf Anderssen vs Lionel Kieseritzky, London. "The Immortal
Game" Lionel Kieseritzky neglects his development and Adolf
Anderssen sacrifices his queen and both rooks for a win.
• 1852: Adolf Anderssen vs Jean Dufresne, Berlin. "The Evergreen
Game". Adolf Anderssen mates with what Savielly Tartakower termed
"[a] combination second to none in the literature of the game."
• 1857: Louis Paulsen vs Paul Morphy, New York. Paul Morphy gains an
advantage in development and transforms it into a powerful kingside
attack with a queen sacrifice.
• 1858: Paul Morphy vs Duke of Brunswick & Count Isouard, Paris.
"The Opera Game" Morphy shows the virtue of quick development and
wins by sacrificing much material, mating on the 17th move with his last
two pieces.
• 1862: Steinitz–Mongredien, London. Wilhelm Steinitz won the
tournament's brilliancy prize for this game.
• 1872: Carl Hamppe vs Philipp Meitner, Vienna. The "Immortal Draw"
between Carl Hamppe and Philipp Meitner, involving a queen
sacrifice.[14]
• 1874: Victor Knorre vs Mikhail Chigorin, St. Petersburg. White's
premature castling on the king side combined with an ineffective pin
allows Mikhail Chigorin to strike back with a violent counterattack
culminating in a brilliant queen sacrifice and subsequent checkmate.
• 1883: Johannes Zukertort vs Joseph Henry Blackburne, London
• 1889: Emanuel Lasker vs Johann Hermann Bauer, Amsterdam.
This game between Emanuel Lasker and Johann Hermann Bauer was the
first famous example of the double bishop sacrifice.
• 1895: Harry Nelson Pillsbury vs Siegbert Tarrasch, Hastings. Harry
Nelson Pillsbury's kingside attack breaks through by a single tempo
against Black's queenside play, against Siegbert Tarrasch, then one of the
strongest players of the world.
• 1895: Steinitz–von Bardeleben, Hastings. This game is famous for its
ten-move mating combination in the final position, which Steinitz
demonstrated after the game.[19] The peculiar circumstance of the
conclusion of this game has been subject of scrutiny.
• 1895: Harry Nelson Pillsbury vs Isidor Gunsberg, Hastings. In the final
round of this prestigious tournament, Pillsbury secures overall victory by
triumphing in an instructive endgame.
• 1896: Harry Nelson Pillsbury vs Emanuel Lasker, Saint
Petersburg. Emanuel Lasker won the brilliancy prize for this game by
exposing Pillsbury's king with the sacrifice of both rooks on the same
square.
1900–1949 :
• 1904: Emanuel Lasker vs William Ewart Napier, Cambridge Springs.
Both players show great ingenuity. After a complicated web of tactics,
Lasker simplifies into a winning endgame.
• 1971: Bruce Harper vs Bob Zuk, Burnaby. The famous "Tomb Game"
(Bruce Harper vs Bob Zuk) sees Black exploit two pins to drive his
opponent's pieces into a corner and toward a position where White's only
legal move will help Black to checkmate him.[67]
• 1972: Bobby Fischer vs Boris Spassky, 6th Match Game,
Reykjavik. Game 6 of the highly publicized World Championship
Match. Bobby Fischer surprises by opening with 1.c4 instead of his
favorite 1.e4. Boris Spassky joined the audience in applauding Fischer's
win and called it the best game of the World Chess Championship 1972.
• 1972: Boris Spassky vs Bobby Fischer, 11th Match Game, Reykjavik.
In Game 11 of the highly publicized World Championship Match, Boris
Spassky destroys Bobby Fischer's Najdorf, giving Fischer his only loss
in the poisoned pawn variation.
• 1972: Boris Spassky vs Bobby Fischer, 13th Match Game,
Reykjavik. Game 13 of the highly publicized World Championship
Match. Bobby Fischer wins this complex contest, defeating Boris
Spassky.
• 1973: David Bronstein vs Ljubomir Ljubojevic, Petropolis Interzonal.
Bronstein, who played a match for the World Championship before his
grandmaster opponent could walk, turns back the clock, sacrifices both
rooks and wins through sheer sorcery.
• 1974: Anatoly Karpov vs Boris Spassky, 9th Match Game, Leningrad.
Former World Champion Boris Spassky can't cope with future World
Champion Anatoly Karpov's subtle, seemingly effortless positional
mastery.
• 1978: Liu Wenzhe vs Jan Hein Donner, Buenos Aires. "The Chinese
Immortal"; at China's first olympiad, the little known Liu Wenzhe
defeats the experienced Dutch grandmaster Jan Hein Donner in 20
moves with a spectacular king's side attack.
1980s :
• 1981: Garry Kasparov vs Viktor Gavrikov, USSR Championship,
Frunze. One of Garry Kasparov's dynamic, attacking wins from his first
Soviet Championship victory at age 18 that heralded the arrival of a new
contender for the World Chess Championship.
• 1984: Lajos Portisch vs Jozsef Pinter, Hungarian Championship,
Budapest. Jozsef Pinter plays the game of his life against his famous
opponent, sacrificing a piece in a queenless middlegame to draw Lajos
Portisch's king into a deadly crossfire.
• 1985: Anatoly Karpov vs Garry Kasparov, 16th Match Game, Moscow.
Garry Kasparov employs a daring gambit and obtains a dominating
Aditya Shukla (B2155R10195014)
Lakee Pandey (B2155R10195029) Chess game development with python
AKS University Satna Department of computer science
position for his knight, stifling Anatoly Karpov's forces and finishing off
with a mating attack.
• 1986: Garry Kasparov vs Anatoly Karpov, 16th Match Game,
Leningrad. The most spectacular game of their third World
Championship match hangs in the balance until Garry Kasparov's
diabolical 37th move blows Karpov's defence away.
• 1987: Garry Kasparov vs Anatoly Karpov, 24th Match Game, Seville.
Trailing by a point before the final game of their fourth World
Championship match, Garry Kasparov surprises Karpov by beginning
quietly in Anatoly Karpov's own style. With Karpov running low on
time, Kasparov ratchets up the tension by sacrificing a pawn for an
attack. Karpov fails to find the best defence and is finally forced to
resign, leaving Kasparov the champion for another three years.
• 1989: Jeroen Piket vs Garry Kasparov, Tilburg. A typically devastating
performance by Garry Kasparov, whose dominance of super-
tournaments in 1989 increased his rating to 2800, the first to reach that
number.
1990s :
• 1990: Anatoly Karpov vs Garry Kasparov, World Chess Championship,
Lyon, 23rd Match Game. The 5th World Championship match between
the two dominant players of the 1980s ends with Karpov winning the
last decisive game but Kasparov winning the match to remain World
Champion.
• 1991: Vassily Ivanchuk vs Artur Yusupov, Brussels, 9th Match Game.
Yusupov sacrifices his knight in his quest for the attack and breaks
through after Ivanchuk's inaccuracies. In 1996, a jury of grandmasters
and readers, voting in the Chess Informant, chose this game as the best
game played in the years 1966–96.
• 1992: Mikhail Tal vs Joel Lautier, Barcelona. In his final tournament
before his death at age 55, the Magician from Riga produces one last
masterpiece against a Grandmaster from the next generation.[83]
• 1992: Vasyl Ivanchuk vs Viswanathan Anand, Linares, 1st Match Game.
Anand breaks all principles of positional chess by getting doubled
pawns, trading his good bishop only to reveal the deep idea later in the
game, managing to create 2 passed pawns and eventually winning the
game .
• 1993: Nigel Short vs Garry Kasparov, PCA World Championship,
London, 8th Match Game. Although the match was one-sided, the games
were hard fought. In this game Short exposes Kasparov's king with a
shower of sacrifices but can't land the knockout blow.[86]
Aditya Shukla (B2155R10195014)
Lakee Pandey (B2155R10195029) Chess game development with python
AKS University Satna Department of computer science
• 1994: Alexey Shirov vs. Judit Polgar, Buenos Aires. The attacking
prowess of the strongest woman chessplayer of all time is on full display
as she rips White's position apart with her pawns and routs his army with
her knights.
• 1995: Roberto Cifuentes Parada vs Vadim Zvjaginsev, Wijk aan Zee.
Black wins with a series of sacrifices that force White's king up to the
6th rank. Known as "The Pearl of Wijk aan Zee".
• 1995: Veselin Topalov vs Vladimir Kramnik, Belgrade. Foreshadowing
their bitter rivalry a decade later, two future World Champions refuse to
draw and throw everything at each other until only one is left standing.
• 1996: Deep Blue versus Kasparov, 1996, Game 1, the first game in
which a chess-playing computer defeated a reigning world
champion using classical time controls.
• 1997: Deep Blue versus Kasparov, 1997, Game 6, the last game of the
1997 rematch. Deep Blue won, making it the first computer to defeat a
world champion in a match.
• 1998: Veselin Topalov vs Alexey Shirov, Linares. Though known for his
attacking play, Alexey Shirov produces "The best move of all time" on
move 47 of a quiet endgame to score a seemingly impossible win.
• 1999: Kasparov–Topalov, Wijk aan Zee 1999. "Kasparov's Immortal"
features a rook sacrifice with a sacrificial combination lasting over 15
moves. One of the most commented chess games ever, with extensive
press coverage.
2020s :
• 2021: Carlsen versus Nepomniachtchi, World Chess Championship
2021, Game 6. In this game, reigning world champion Magnus
Carlsen (as White) exchanged his queen for two rooks to enter into an
unbalanced endgame—which was drawn, according to the endgame
tablebases, after only seven pieces remained on the board—but
challenger Ian Nepomniachtchi (as Black) committed a decisive mistake
on move 130 and resigned after Carlsen's 136th move.[112] It was the first
decisive classical game in a World Chess Championship in more than
five years, ending the longest-ever streak of 19 draws in consecutive
World Chess Championship classical games, and the 136-move game
became the longest in the history of the World Chess Championship.[114]
The programming language Python was conceived in the late 1980s, and its
implementation was started in December 1989 by Guido van
Rossum at CWI in the Netherlands as a successor to ABC capable of exception
handling and interfacing with the Amoeba operating system. Van Rossum is
Python's principal author, and his continuing central role in deciding the direction
of Python is reflected in the title given to him by the Python
community, Benevolent Dictator for Life (BDFL). (However, Van Rossum
stepped down as leader on July 12, 2018.[6]). Python was named after the BBC
TV show Monty Python's Flying Circus.
Python 2.0 was released on October 16, 2000, with many major new features,
including a cycle-detecting garbage collector (in addition to reference counting)
for memory management and support for Unicode, along with a change to the
development process itself, with a shift to a more transparent and community-
backed process.
Python 3.0, a major, backwards-incompatible release, was released on December
3, 2008[9] after a long period of testing. Many of its major features have also
been backported to the backwards-compatible, though now-unsupported, Python
2.6 and 2.7.
Early history
In February 1991, Van Rossum published the code (labeled version 0.9.0) to
alt.sources.[11][12] Already present at this stage in development were classes with
inheritance, exception handling, functions, and the
core datatypes of list, dict, str and so on. Also in this initial release was a module
system borrowed from Modula-3; Van Rossum describes the module as "one of
Python's major programming units".[1] Python's exception model also resembles
Modula-3's, with the addition of an else clause.[3] In 1994 comp.lang.python, the
primary discussion forum for Python, was formed, marking a milestone in the
growth of Python's userbase.[1]
Version 1
Python reached version 1.0 in January 1994. The major new features included in
this release were the functional programming
tools lambda, map, filter and reduce. Van Rossum stated that "Python acquired
lambda, reduce(), filter() and map(), courtesy of a Lisp hacker who missed them
and submitted working patches".[13]
The last version released while Van Rossum was at CWI was Python 1.2. In
1995, Van Rossum continued his work on Python at the Corporation for National
Research Initiatives (CNRI) in Reston, Virginia from where he released several
versions.
By version 1.4, Python had acquired several new features. Notable among these
are the Modula-3 inspired keyword arguments (which are also similar
to Common Lisp's keyword arguments) and built-in support for complex
numbers. Also included is a basic form of data hiding by name mangling, though
this is easily bypassed.[14]
During Van Rossum's stay at CNRI, he launched the Computer Programming for
Everybody (CP4E) initiative, intending to make programming more accessible to
more people, with a basic "literacy" in programming languages, similar to the
basic English literacy and mathematics skills required by most employers.
Python served a central role in this: because of its focus on clean syntax, it was
already suitable, and CP4E's goals bore similarities to its predecessor, ABC. The
project was funded by DARPA.[15] As of 2007, the CP4E project is inactive, and
while Python attempts to be easily learnable and not too arcane in its syntax and
semantics, outreach to non-programmers is not an active concern.[16]
BeOpen
Version 2
Historic Python logos used on Windows (left) and the Macintosh (centre), and
the logo used since version 2.5 (right).
Python 2.5 was released in September 2006 ] and introduced the with statement,
which encloses a code block within a context manager (for example, acquiring
a lock before the block of code is run and releasing the lock afterwards, or
opening a file and then closing it), allowing resource acquisition is
initialization (RAII)-like behavior and replacing a common try/finally idiom.
Python 2.6 was released to coincide with Python 3.0, and included some features
from that release, as well as a "warnings" mode that highlighted the use of
features that were removed in Python 3.0. Similarly, Python 2.7 coincided with
and included features from Python 3.1,] which was released on June 26, 2009.
Parallel 2.x and 3.x releases then ceased, and Python 2.7 was the last release in
the 2.x series. In November 2014, it was announced that Python 2.7 would be
supported until 2020, but users were encouraged to move to Python 3 as soon as
possible. Python 2.7 support ended on January 1, 2020, along with code freeze of
2.7 development branch. A final release, 2.7.18, occurred on April 20, 2020, and
included fixes for critical bugs and release blockers.[31] This marked the end-of-
life of Python 2.
Version 3
Python 3.0 (also called "Python 3000" or "Py3K") was released on December 3,
2008.[9] It was designed to rectify fundamental design flaws in the language – the
changes required could not be implemented while retaining full backwards
compatibility with the 2.x series, which necessitated a new major version
number. The guiding principle of Python 3 was: "reduce feature duplication by
removing old ways of doing things".[33]
Python 3.0 was developed with the same philosophy as in prior versions.
However, as Python had accumulated new and redundant ways to program the
Aditya Shukla (B2155R10195014)
Lakee Pandey (B2155R10195029) Chess game development with python
AKS University Satna Department of computer science
same task, Python 3.0 had an emphasis on removing duplicative constructs and
modules, in keeping with the Zen of Python: "There should be one— and
preferably only one —obvious way to do it".
Nonetheless, Python 3.0 remained a multi-paradigm language. Coders could still
follow object-oriented, structured, and functional programming paradigms,
among others, but within such broad choices, the details were intended to be
more obvious in Python 3.0 than they were in Python 2.x.
Compatibility
Python 3.0 broke backward compatibility, and much Python 2 code does not run
unmodified on Python 3.[34] Python's dynamic typing combined with the plans to
change the semantics of certain methods of dictionaries, for example, made
perfect mechanical translation from Python 2.x to Python 3.0 very difficult. A
tool called "2to3" does the parts of translation that can be done automatically. At
this, 2to3 appeared to be fairly successful, though an early review noted that
there were aspects of translation that such a tool would never be able to
handle.[35] Prior to the roll-out of Python 3, projects requiring compatibility with
both the 2.x and 3.x series were recommended to have one source (for the 2.x
series), and produce releases for the Python 3.x platform using 2to3. Edits to the
Python 3.x code were discouraged for so long as the code needed to run on
Python 2.x.[10] This is no longer recommended; as of 2012 the preferred approach
was to create a single code base that can run under both Python 2 and 3 using
compatibility modules.
Features :
Some of the major changes included for Python 3.0 were:
• Moving reduce (but not map or filter) out of the built-in namespace and
into functools (the rationale being code that uses reduce is less readable
than code that uses a for loop and accumulator variable)[38][39]
• Adding support for optional function annotations that can be used
for informal type declarations or other purposes[40]
• Unifying the str/unicode types, representing text, and introducing a
separate immutable bytes type; and a mostly corresponding
mutable bytearray type, both of which represent arrays of bytes[41]
• Removing backward-compatibility features, including old-style classes,
string exceptions, and implicit relative imports
• A change in integer division functionality: in Python 2, integer division
always returns an integer. For example 5 / 2 is 2; whereas in Python 3, 5
/ 2 is 2.5. (In both Python 2 – 2.2 onwards – and Python 3, a separate
operator exists to provide the old behavior: 5 // 2 is 2)
Subsequent releases in the Python 3.x series have included additional, substantial
new features; all ongoing development of the language is done in the 3.x series.
• The for statement, which iterates over an iterable object, capturing each
element to a local variable for use by the attached block
• The while statement, which executes a block of code as long as its
condition is true
• The try statement, which allows exceptions raised in its attached code
block to be caught and handled by except clauses (or new
syntax except* in Python 3.11 for exception groups[96]); it also ensures
that clean-up code in a finally block is always run regardless of how the
block exits
• The raise statement, used to raise a specified exception or re-raise a
caught exception
• The class statement, which executes a block of code and attaches its
local namespace to a class, for use in object-oriented programming
• The def statement, which defines a function or method
• The with statement, which encloses a code block within a context
manager (for example, acquiring a lock before it is run, then releasing
the lock; or opening and closing a file), allowing resource-acquisition-is-
initialization (RAII)-like behavior and replacing a common try/finally
idiom[97]
• The break statement, which exits a loop
• The continue statement, which skips the rest of the current iteration and
continues with the next
• The del statement, which removes a variable—deleting the reference
from the name to the value, and producing an error if the variable is
referred to before it is redefined
• The pass statement, serving as a NOP, syntactically needed to create an
empty code block
• The assert statement, used in debugging to check for conditions that
should apply
• The yield statement, which returns a value from a generator function
(and also an operator); used to implement coroutines
• The return statement, used to return a value from a function
• The import and from statements, used to import modules whose
functions or variables can be used in the current program
The assignment statement (=) binds a name as a reference to a separate,
dynamically allocated object. Variables may subsequently be rebound at any time
to any object. In Python, a variable name is a generic reference holder without a
fixed data type; however, it always refers to some object with a type. This is
called dynamic typing—in contrast to statically-typed languages, where each
variable may contain only a value of a certain type.
Aditya Shukla (B2155R10195014)
Lakee Pandey (B2155R10195029) Chess game development with python
AKS University Satna Department of computer science
Python does not support tail call optimization or first-class continuations, and,
according to Van Rossum, it never will. However, better support for coroutine-
like functionality is provided by extending Python's generators. Before 2.5,
generators were lazy iterators; data was passed unidirectionally out of the
generator. From Python 2.5 on, it is possible to pass data back into a generator
function; and from version 3.3, it can be passed through multiple stack levels.
Expressions
Python's expressions include:
negative indexes are relative to the end. Slices take elements from
the start index up to, but not including, the stop index. The third slice
parameter, called step or stride, allows elements to be skipped and
reversed. Slice indexes may be omitted—for example, a[:] returns a
copy of the entire list. Each element of a slice is a shallow copy.
In Python, a distinction between expressions and statements is rigidly enforced,
in contrast to languages such as Common Lisp, Scheme, or Ruby. This leads to
duplicating some functionality. For example:
Arithmetic operations :
Python has the usual symbols for arithmetic operators (+, -, *, /), the floor
division operator // and the modulo operation % (where the remainder can be
negative, e.g. 4 % -3 == -2). It also has ** for exponentiation, e.g. 5**3 ==
125 and 9**0.5 == 3.0, and a matrix-multiplication operator @ .[120] These
operators work like in traditional math; with the same precedence rules, the
operators infix (+ and - can also be unary to represent positive and negative
numbers respectively).
The division between integers produces floating-point results. The behavior of
division has changed significantly over time:[121]
always true. It also means that the equation b*(a//b) + a%b == a is valid for both
positive and negative values of a. However, maintaining the validity of this
equation means that while the result of a%b is, as expected, in the half-open
interval [0, b), where b is a positive integer, it has to lie in the interval (b, 0]
when b is negative.[122]
Python provides a round function for rounding a float to the nearest integer.
For tie-breaking, Python 3 uses round to even: round(1.5) and round(2.5) both
produce 2.[123] Versions before 3 used round-away-from-
zero: round(0.5) is 1.0, round(-0.5) is −1.0.[124]
Python allows Boolean expressions with multiple equality relations in a manner
that is consistent with general use in mathematics. For example, the expression a
< b < c tests whether a is less than b and b is less than c.[125] C-derived languages
interpret this expression differently: in C, the expression would first evaluate a <
b, resulting in 0 or 1, and that result would then be compared with c.[126]
Python uses arbitrary-precision arithmetic for all integer operations.
The Decimal type/class in the decimal module provides decimal floating-point
numbers to a pre-defined arbitrary precision and several rounding
modes. The Fraction class in the fractions module provides arbitrary precision
for rational numbers.
Due to Python's extensive mathematics library, and the third-party
library NumPy that further extends the native capabilities, it is frequently used as
a scientific scripting language to aid in problems such as numerical data
processing and manipulation.
Libraries :
Python's large standard library[131] provides tools suited to many tasks and is
commonly cited as one of its greatest strengths. For Internet-facing applications,
many standard formats and protocols such as MIME and HTTP are supported. It
includes modules for creating graphical user interfaces, connecting to relational
databases, generating pseudorandom numbers, arithmetic with arbitrary-precision
decimals,[127] manipulating regular expressions, and unit testing.
Some parts of the standard library are covered by specifications—for example,
the Web Server Gateway Interface (WSGI) implementation wsgiref follows PEP
333[132]—but most are specified by their code, internal documentation, and test
suites. However, because most of the standard library is cross-platform Python
code, only a few modules need altering or rewriting for variant implementations.
As of 17 March 2024, the Python Package Index (PyPI), the official repository
for third-party Python software, contains over 523,000[133] packages with a wide
range of functionality, including:
• Automation
• Data analytics
• Databases
• Documentation
• Graphical user interfaces
• Image processing
• Machine learning
• Mobile apps
• Multimedia
• Computer networking
• Scientific computing
• System administration
• Test frameworks
• Text processing
• Web frameworks
• Web scraping
Development environments
Most Python implementations (including CPython) include a read–eval–print
loop (REPL), permitting them to function as a command line interpreter for
which users enter statements sequentially and receive results immediately.
Python also comes with an Integrated development environment
(IDE) called IDLE, which is more beginner-oriented.
Other shells, including IDLE and IPython, add further abilities such as improved
auto-completion, session state retention, and syntax highlighting.
As well as standard desktop integrated development environments including
PyCharm, IntelliJ Idea, Visual Studio Code etc, there are web browser-based
IDEs, including SageMath, for developing science- and math-related
programs; PythonAnywhere, a browser-based IDE and hosting environment; and
Canopy IDE, a commercial IDE emphasizing scientific computing.[134]
Implementations :
Reference implementation
CPython is the reference implementation of Python. It is written in C, meeting
the C89 standard (Python 3.11 uses C11[135]) with several select C99 features.
CPython includes its own C extensions, but third-party extensions are not limited
to older C versions—e.g. they can be implemented with C11 or
C++.[136][137] CPython compiles Python programs into an
intermediate bytecode[138] which is then executed by its virtual
machine.[139] CPython is distributed with a large standard library written in a
mixture of C and native Python, and is available for many platforms, including
Windows (starting with Python 3.9, the Python installer deliberately fails to
install on Windows 7 and 8;[140][141] Windows XP was supported until Python 3.5)
and most modern Unix-like systems, including macOS (and Apple M1 Macs,
since Python 3.9.1, with experimental installer), with unofficial support
for VMS.[142] Platform portability was one of its earliest priorities.[143] (During
Python 1 and 2 development, even OS/2 and Solaris were supported,[144] but
support has since been dropped for many platforms.)
Python, since 3.7, only supports operating systems with multi-threading support.
Other implementations :
Unsupported implementations:
Other just-in-time Python compilers have been developed, but are now
unsupported:
• Google began a project named Unladen Swallow in 2009, with the aim
of speeding up the Python interpreter five-fold by using the LLVM, and
of improving its multithreading ability to scale to thousands of
cores,[156] while ordinary implementations suffer from the global
interpreter lock.
• Psyco is a discontinued just-in-time specializing compiler that integrates
with CPython and transforms bytecode to machine code at runtime. The
emitted code is specialized for certain data types and is faster than the
standard Python code. Psyco does not support Python 2.7 or later.
• PyS60 was a Python 2 interpreter for Series 60 mobile phones released
by Nokia in 2005. It implemented many of the modules from the
standard library and some additional modules for integrating with
the Symbian operating system. The Nokia N900 also supports Python
with GTK widget libraries, enabling programs to be written and run on
the target device.
Performance:
Performance comparison of various Python implementations on a non-numerical
(combinatorial) workload was presented at EuroSciPy '13.[172] Python's
Development:
Python's development is conducted largely through the Python Enhancement
Proposal (PEP) process, the primary mechanism for proposing major new
features, collecting community input on issues, and documenting Python design
decisions.[174] Python coding style is covered in PEP 8.[175] Outstanding PEPs are
reviewed and commented on by the Python community and the steering
council.[174]
Enhancement of the language corresponds with the development of the CPython
reference implementation. The mailing list python-dev is the primary forum for
the language's development. Specific issues were originally discussed in
the Roundup bug tracker hosted at by the foundation.[176] In 2022, all issues and
discussions were migrated to GitHub.[177] Development originally took place on
a self-hosted source-code repository running Mercurial, until Python moved
to GitHub in January 2017.[178]
CPython's public releases come in three types, distinguished by which part of the
version number is incremented:
The major academic conference on Python is PyCon. There are also special
Python mentoring programs, such as PyLadies.
Python 3.12 removed wstr meaning Python extensions[185] need to be
modified,[186] and 3.10 added pattern matching to the language.[187]
Python 3.12 dropped some outdated modules, and more will be dropped in the
future, deprecated as of 3.13; already deprecated array 'u' format code will
emit DeprecationWarning since 3.13 and will be removed in Python 3.16. The 'w'
format code should be used instead. Part of ctypes is also deprecated
and http.server.CGIHTTPRequestHandler will emit a DeprecationWarning, and
will be removed in 3.15. Using that code already has a high potential for both
security and functionality bugs. Parts of the typing module are deprecated, e.g.
creating a typing.NamedTuple class using keyword arguments to denote the
fields and such (and more) will be disallowed in Python 3.15.
Naming:
Python's name is derived from the British comedy group Monty Python, whom
Python creator Guido van Rossum enjoyed while developing the language.
Monty Python references appear frequently in Python code and culture;[189] for
example, the metasyntactic variables often used in Python literature
are spam and eggs instead of the traditional foo and bar.[189][190] The official
Python documentation also contains various references to Monty Python
routines.[191][192] Users of Python are sometimes referred to as "Pythonistas".[193]
The prefix Py- is used to show that something is related to Python. Examples of
the use of this prefix in names of Python applications or libraries
include Pygame, a binding of SDL to Python (commonly used to create
games); PyQt and PyGTK, which bind Qt and GTK to Python respectively;
and PyPy, a Python implementation originally written in Python.
Popularity:
Since 2003, Python has consistently ranked in the top ten most popular
programming languages in the TIOBE Programming Community Index where as
Aditya Shukla (B2155R10195014)
Lakee Pandey (B2155R10195029) Chess game development with python
AKS University Satna Department of computer science
Uses:
Python Powered
Python can serve as a scripting language for web applications, e.g.
via mod_wsgi for the Apache webserver.[205] With Web Server Gateway
Interface, a standard API has evolved to facilitate these applications. Web
frameworks like Django, Pylons, Pyramid, TurboGears, web2py, Tornado, Flask,
Bottle, and Zope support developers in the design and maintenance of complex
applications. Pyjs and IronPython can be used to develop the client-side of Ajax-
based applications. SQLAlchemy can be used as a data mapper to a relational
database. Twisted is a framework to program communications between
computers, and is used (for example) by Dropbox.
Libraries such as NumPy, SciPy and Matplotlib allow the effective use of Python
in scientific computing,[206][207] with specialized libraries such
as Biopython and Astropy providing domain-specific functionality. SageMath is
a computer algebra system with a notebook interface programmable in Python:
its library covers many aspects of mathematics,
including algebra, combinatorics, numerical mathematics, number theory,
and calculus.[208] OpenCV has Python bindings with a rich set of features
for computer vision and image processing.
Python is commonly used in artificial intelligence projects and machine learning
projects with the help of libraries like TensorFlow, Keras, Pytorch, scikit-
learn and the Logic language ProbLog. As a scripting language with a modular
Aditya Shukla (B2155R10195014)
Lakee Pandey (B2155R10195029) Chess game development with python
AKS University Satna Department of computer science
architecture, simple syntax, and rich text processing tools, Python is often used
for natural language processing.
The combination of Python and Prolog has proved to be particularly useful for AI
applications, with Prolog providing knowledge representation and reasoning
capablities. The Janus system, in particular, exploits the similarites between these
two languages, in part because of their use of dynamic typing, and the simple
recursive nature of their data structures. Typical applications of this combination
include natural language processing, visual query answering, geospatial
reasoning, and handling of semantic web data. The Natlog system, implemented
in Python, uses Definite Clause Grammars (DCGs) as prompt generators for text-
to-text generators like GPT3 and text-to-image generators like DALL-E or Stable
Diffusion.
Python can also be used for graphical user interface (GUI) by using libraries
like Tkinter.
Python has been successfully embedded in many software products as a scripting
language, including in finite element method software such as Abaqus, 3D
parametric modelers like FreeCAD, 3D animation packages such as 3ds
Max, Blender, Cinema
4D, Lightwave, Houdini, Maya, modo, MotionBuilder, Softimage, the visual
effects compositor Nuke, 2D imaging programs
like GIMP,[221] Inkscape, Scribus and Paint Shop Pro, and musical
notation programs like scorewriter and capella. GNU Debugger uses Python as
a pretty printer to show complex structures such as C++
containers. Esri promotes Python as the best choice for writing scripts
in ArcGIS.[223] It has also been used in several video games, and has been
adopted as first of the three available programming languages in Google App
Engine, the other two being Java and Go.
Many operating systems include Python as a standard component. It ships with
most Linux distributions, AmigaOS 4 (using Python 2.7), FreeBSD (as a
package), NetBSD, and OpenBSD (as a package) and can be used from the
command line (terminal). Many Linux distributions use installers written in
Python: Ubuntu uses the Ubiquity installer, while Red Hat Linux and Fedora
Linux use the Anaconda installer. Gentoo Linux uses Python in its package
management system, Portage.
Python is used extensively in the information security industry, including in
exploit development.
Most of the Sugar software for the One Laptop per Child XO, developed at Sugar
Labs as of 2008, is written in Python.[230] The Raspberry Pi single-board
computer project has adopted Python as its main user-programming language.
LibreOffice includes Python and intends to replace Java with Python. Its Python
Scripting Provider is a core feature since Version 4.0 from 7 February 2013.
Project :-
1. Install Python: If you haven't already, download and install Python from
the official website (https://www. python.org/downloads/). Make sure to
choose the latest stable version.
2. Pygame Installation: Pygame is a powerful library that simplifies game
development. You can install it using pip by running the following
command in your terminal or command prompt:
we'll start building the chessboard. We'll create a graphical interface using
Pygame and set up the initial chessboard layout.
import pygame
pygame.init()
We are making the foloder and inside the folder there are photos of
various component of the chess li king queen bishop pawns etc…