Skip to content

Commit

Permalink
Update license header
Browse files Browse the repository at this point in the history
  • Loading branch information
aleiavicoli committed Nov 9, 2023
1 parent 436e28d commit 792da42
Show file tree
Hide file tree
Showing 70 changed files with 327 additions and 201 deletions.
104 changes: 28 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,40 @@
# AdaChess - Smart Chess Engine

AdaChess is an open source chess engine written entirely in the Ada programming language. So far, AdaChess played the IGT 2014, IGT 2015, IGT 2016, IGT 2017, IGT 2018 and IGT 2019 G-6 tournaments, and the PT 54 CSVN tournament, all over the board.
The playing strength of AdaChess is around 2100 Elo. See the updated ELO at the [CCRL rating](http://ccrl.chessdom.com/ccrl/4040/) and [CCRL Blitz](http://ccrl.chessdom.com/ccrl/404/).

For further information about the engine, please refer to the [Chess Programming Wiki](https://www.chessprogramming.org/AdaChess) page of the engine

The source code should be very readable and it is well commented. You need anyway a basic knowledge on chess programming to understand how components works together.
AdaChess is a true original chess engine written with fun and cool ideas in mind.

## Engine features

AdaChess is an intermediate/advanced engine that comes with many features, many of them unique. Here a list of the most important:
- Board representation as array of 120 squares
- Pieces-list to track piece position
- Legal move generator
- Complete set of time control (the clock is handled in a separate thread)
- Statistical data for perft and divide (see https://www.chessprogramming.org/Perft_Results, most of those data have been generated by AdaChess)
- Complete evaluation function that takes into account:
- Pawn structure: penalties/bonused for doubled, isolated, exposed, backwards, passed, unstoppable passers, candidate, supported, outposts, and so on
- King safety (based on attack on the king zone, pawn shield and opponent pawn storm, open columns around the king)
- Mobiliy (consider also x-ray mobility of bishop and rook through queens)
- Other factors like material balance, trapped rooks/bishops, bishop pairs, rooks on (semi)open files and on 7th/2nd square and so on
- Search based on AlphaBeta with Itearative deeping and Quiescence
- Transposition Tables
- Late Move Reduction
- Advanced SEE, takes into account also checks and moves on dangerous squares (empty squares attacked by opponent pieces)
- Null Move observation with verification for zugzwang
- Extensions/reductions mainly based on tactical moves and history data
- Advanced Opening book handling:
- Use any PGN as opening book as well as multiple PGNs (specify from command line)
- Support for simple opening books with one game per line (old style)
- Support for the following notation: Standard Algebraic (fully disambiguated), Long Algebraic, ICCF and Winboard/UCI notation
- Note: the divide command output with the desired notation
- Support Winboard/Xboard communication protocol
- Read/Write FEN positions

Although you can play AdaChess from console, it is strongly reccomend to use an external UI that support Winboard/Xboard protocol and setup the engine. The two UI are Winboard and Arena.

# Performance

On my laptop (Intel i5, 4Gb of ram):
- perft 6 from the starting position in 5.5 seconds (around 21M position per seconds),
- searches for around 500K NPS
- reaches an average of 10-11 depth search in a middle game in around 5 second

# Planned features

- Add UCI support
- Support for pawn hash tables
- Automatic tuning of evaluation parameters
- Further selectivity algorithms in search
- Any other ideas that is cool to have or to implement

# Compile and Run AdaChess

The fastest way to compile AdaChess is to download an Ada compiler and open the gpr file (adachess.gpr). Be sure that the scenario mode is on "release" and compile it. The executable will be on the same directory.
AdaChess is an open source chess engine written entirely in the Ada programming language. The official page of the engine, with more detailed information, can be found in the [Chess Programming Wiki](https://www.chessprogramming.org/AdaChess).

To use a PGN file as opening book, place the PGN in the same directory of the engine and run it with the --opening-book command line option, for example:
- adachess.exe --opening-book Kasparov.pgn
if you wish to use more opening books on the same time just add more command line options:
- adachess.exe --opening-book Kasparov.pgn --opening-book Carlsen.pgn --opening-book default.pgn
The main goal while developing the engine is to have fun and add new cool functionalities.

Starting from the version 4.0 the engine source code and an executable for windows are available on this repository. Feel free to download them and create new cool bugs.

AdaChess is a true original chess engine written completely from scratch as hobby project. The main goal are having a lot of fun and implementing cool, original ideas.

## Download

The latest version of the engine is the release 4.0.

Note that parsing the PGN files will take some time and huge books can take minutes to be loaded.

## Using AdaChess with Arena or Winboard

To use AdaChess with an external UI please refer to the pdf documentation inside the DOC folder
Note: Although you can play AdaChess via console, I recommend to use an external GUI that support Winboard/Xboard protocol and setup the engine.

# License

AdaChess is a GPL licenced software, if comes with source code and binaries for Windows (executable) in order to be used without compilation. The binaries are availabe at the official engine internet site https://www.adachess.com. Download, play and enjoy!
## Some cool features

AdaChess is an intermediate/advanced engine that comes with many features, many of them unique. Here a list of the most cool:
- Legal move generator with check-investigation
- Statistical data for perft and divide (see [Perft Results](https://www.chessprogramming.org/Perft_Results). In the moment I am writing, all the data except the node count were generated with AdaChess)
- Move annotation in real time (new in release 4.0). The engine decide whether a move is brilliant/good/interesting and will print out this information in the pv. This feature is still a bit experimental, but the premises are very good.

<!--
**adachess/AdaChess** is a ✨ _special_ ✨ repository because its `README.md` (this file) appears on your GitHub profile.
## Compile and Run AdaChess

The fastest way to compile AdaChess is to download an Ada compiler and the Gnat Programming Studio via AdaCore (you can use alire for this) and open the gpr file (adachess.gpr). **Be sure that the scenario mode is on "release"** and compile it. The executable will be created on the same directory.

To use a PGN file as opening book, place the PGN in the same directory of the engine and run it with the --opening-book command line option, for example:
- adachess.exe --opening-book Kasparov.pgn
if you wish to use more opening books on the same time just add more command line options:
- adachess.exe --opening-book Kasparov.pgn --opening-book Carlsen.pgn --opening-book default.pgn

Note that parsing the PGN files will take some time and huge books can take minutes to be loaded.

Here are some ideas to get you started:
## License

- 🔭 I’m currently working on ...
- 🌱 I’m currently learning ...
- 👯 I’m looking to collaborate on ...
- 🤔 I’m looking for help with ...
- 💬 Ask me about ...
- 📫 How to reach me: ...
- 😄 Pronouns: ...
- ⚡ Fun fact: ...
-->
AdaChess is a GPL licenced software, it comes with source code and binaries for Windows (executable). Download, play and enjoy!
2 changes: 1 addition & 1 deletion src/acmultiprocessor.ads
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/adachess.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion src/changelog.ads
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-board-attacks_data.adb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
5 changes: 3 additions & 2 deletions src/chess-board-attacks_data.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand All @@ -17,6 +17,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.


with Chess.Board.Directions; use Chess.Board.Directions;


Expand Down
4 changes: 2 additions & 2 deletions src/chess-board-directions.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-board.adb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-board.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-books-openings.adb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-books-openings.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-books.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-clocks.adb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-clocks.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
6 changes: 3 additions & 3 deletions src/chess-colors.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand All @@ -15,7 +15,7 @@
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>
-- along with this program. If not, see <http://www.gnu.org/licenses/>.


package Chess.Colors is
Expand Down
4 changes: 2 additions & 2 deletions src/chess-depths.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-distances.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-engine-evaluations-static_evaluations.adb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-engine-evaluations-static_evaluations.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-engine-evaluations.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-engine-perfts.adb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-engine-perfts.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
6 changes: 3 additions & 3 deletions src/chess-engine-ponder.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Cool Chess Engine
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2019 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: http://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-engine-pv.adb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions src/chess-engine-pv.ads
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
--
-- AdaChess - Smart Chess Engine
--
-- Copyright (C) 2013-2022 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://www.adachess.com
-- Copyright (C) 2013-2023 - Alessandro Iavicoli
-- Email: [email protected] - Web Page: https://github.com/adachess/AdaChess
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand Down
Loading

0 comments on commit 792da42

Please sign in to comment.