Coder Social home page Coder Social logo

philleski / tactician Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 359 KB

An AI program that plays chess by reading in moves from the command line

License: MIT License

Java 100.00%
chess-engine chess engine java uci bitboard alpha-beta-pruning alpha-beta

tactician's Introduction

Tactician

An AI program that plays chess by reading in moves from the command line.

Demo

The image below links to a YouTube video of one of Tactician's games. In this video Tactician played white against chess.com's computer set to Level 4.

Tactician vs. Chess.com Level 4 Replay

Compiling

In Eclipse, go to File -> Export. Then in the Java directory, select Runnable Jar File. Note the location of the exported file.

Running

Since this is just a chess engine without a GUI, you'll need to install a GUI in order to play. I would recommend ScidvsMac.

In ScidvsMac go to Tools -> Analysis Engines. Create an engine with the following configuration:

Name: chess-engine

Command: /usr/bin/java

Directory: .

Parameters: -Xms512M -Xmx1524M -jar ~/tactician.jar

The two parameter options give the program extra memory for the transposition tables.

Once the engine is configured you can play a game in ScidvsMac by going to Play -> Computer - UCI Engine. If you'd like to play as black they have an icon for that right above the board.

Testing

The JUnit tests are located in the Test subfolder. They should all pass before committing to the master branch. Ideally the time to run performance tests in TestPerformance.java should be comparable to the previous build, unless there is a good enough reason for the lower performance.

Style

We use the Google Java style guide for this project: https://google.github.io/styleguide/javaguide.html

tactician's People

Contributors

philleski avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tactician's Issues

Tactician without commandline parameter on Windows 7 64 bit

Hello philleski,
for Windows 7 64 bit, does it requires JRE 8 or 9?

(I have Windows 7 32 bit and 64 bit), cf debug :

2018-04-03 07:03:48,414 Arena 3.5.1
2018-04-03 07:03:48,414Font Arena Chess Figurine MISSING

2018-04-03 07:03:48,710**----------Neue Partie---2018-04-03 07:03:48,710 Di -------------
2018-04-03 07:03:48,819screen: 1280x1024
2018-04-03 07:03:48,819
Monitors: 1
2018-04-03 07:03:48,819Monitor0: 1280x1024
2018-04-03 07:03:48,819
FormMonitor: 0
2018-04-03 07:03:48,819DesktopRect: 0/0 .. 1280/1024
2018-04-03 07:04:09,8891--------------------------Starte Motor 1 Tactician--------------------------
2018-04-03 07:04:09,8891Configured Engine 1 Type: Auto
2018-04-03 07:04:09,8891Engine 1 dir: C:\Users\NRL\Downloads
2018-04-03 07:04:09,8891Engine 1 commandline: java -jar C:\Users\NRL\Downloads\tactician.jar
2018-04-03 07:04:10,0151Engine 1 ProcessID: 2904
2018-04-03 07:04:10,0151Engine 1 Prio:32 ThreadPrio:0
2018-04-03 07:04:10,017-->1:xboard
2018-04-03 07:04:10,050-->1:uci
2018-04-03 07:04:10,346<--1:Could not write message to log file: < xboard
2018-04-03 07:04:10,346<--1:Could not write message to log file: < uci
2018-04-03 07:04:10,346<--1:Could not write message to log file: > id name Tactician
2018-04-03 07:04:10,346<--1:id name Tactician
2018-04-03 07:04:10,346<--1:Could not write message to log file: > id author Phil Leszczynski
2018-04-03 07:04:10,346<--1:id author Phil Leszczynski
2018-04-03 07:04:10,346<--1:Could not write message to log file: > uciok
2018-04-03 07:04:10,346<--1:uciok
2018-04-03 07:04:10,346-->1:isready
2018-04-03 07:04:10,393<--1:Could not write message to log file: < isready
2018-04-03 07:04:10,393<--1:Could not write message to log file: > readyok
2018-04-03 07:04:10,393<--1:readyok
2018-04-03 07:04:41,4681Start calc, move no: 1
2018-04-03 07:04:41,468-->1:ucinewgame
2018-04-03 07:04:41,468-->1:isready
2018-04-03 07:04:41,468<--1:Could not write message to log file: < ucinewgame
2018-04-03 07:04:41,468<--1:Could not write message to log file: < isready
2018-04-03 07:04:41,468<--1:Could not write message to log file: > readyok
2018-04-03 07:04:41,468<--1:readyok
2018-04-03 07:04:41,484-->1:position startpos moves d2d4
2018-04-03 07:04:41,484-->1:go wtime 120000 btime 120000 winc 0 binc 0 movestogo 40
2018-04-03 07:04:41,484<--1:Could not write message to log file: < position startpos moves d2d4
2018-04-03 07:04:41,484<--1:Could not write message to log file: < go wtime 120000 btime 120000 winc 0 binc 0 movestogo 40
2018-04-03 07:04:43,106<--1:Could not write message to log file: PV: [ee2e4, ee7e5, Bf1b5, Bf8b4, Ke1f1, Ke8f8]
2018-04-03 07:04:43,106<--1:Could not write message to log file: > bestmove e2e4
2018-04-03 07:04:43,106<--1:bestmove e2e4
2018-04-03 07:04:43,106moveerror white moved but it is black's turn !e2-e4!
2018-04-03 07:04:43,106moveerror R illegal move detected by movegen, sorry, no more details !...!
2018-04-03 07:04:43,1061---------> Arena:Illegaler Zug!: "bestmove e2e4" ()
2018-04-03 07:04:51,577
----------Neue Partie---2018-04-03 07:04:51,577 Di -------------
2018-04-03 07:04:57,2871Start calc, move no: 0
2018-04-03 07:04:57,287-->1:ucinewgame
2018-04-03 07:04:57,287-->1:isready
2018-04-03 07:04:57,287<--1:Could not write message to log file: < ucinewgame
2018-04-03 07:04:57,287<--1:Could not write message to log file: < isready
2018-04-03 07:04:57,287<--1:Could not write message to log file: > readyok
2018-04-03 07:04:57,287<--1:readyok
2018-04-03 07:04:57,302-->1:position startpos
2018-04-03 07:04:57,302-->1:go wtime 120000 btime 120000 winc 0 binc 0 movestogo 40
2018-04-03 07:04:57,302<--1:Could not write message to log file: < position startpos
2018-04-03 07:04:57,302<--1:Could not write message to log file: < go wtime 120000 btime 120000 winc 0 binc 0 movestogo 40
2018-04-03 07:05:00,485<--1:Could not write message to log file: PV: [dd2d3, dd7d6, Nb1a3, Ng8f6, Bc1d2, Bb4xd2]
2018-04-03 07:05:00,485<--1:Could not write message to log file: > bestmove d2d3
2018-04-03 07:05:00,485<--1:bestmove d2d3
2018-04-03 07:05:00,4851Zug gefunden:d2-d3
2018-04-03 07:05:06,3971Start calc, move no: 2
2018-04-03 07:05:06,397-->1:position startpos moves d2d3 c7c5
2018-04-03 07:05:06,397-->1:go wtime 116823 btime 114571 winc 0 binc 0 movestogo 39
2018-04-03 07:05:06,397<--1:Could not write message to log file: < position startpos moves d2d3 c7c5
2018-04-03 07:05:06,397<--1:Could not write message to log file: < go wtime 116823 btime 114571 winc 0 binc 0 movestogo 39
2018-04-03 07:05:07,177<--1:Could not write message to log file: PV: [Qd1xd2, Kf8g8]
2018-04-03 07:05:07,177<--1:Could not write message to log file: > bestmove d1d2
2018-04-03 07:05:07,177<--1:bestmove d1d2
2018-04-03 07:05:07,1771Zug gefunden:Dd1-d2
2018-04-03 07:05:10,3911Start calc, move no: 4
2018-04-03 07:05:10,391-->1:position startpos moves d2d3 c7c5 d1d2 b7b6
2018-04-03 07:05:10,391-->1:go wtime 116048 btime 111825 winc 0 binc 0 movestogo 38
2018-04-03 07:05:10,391<--1:Could not write message to log file: < position startpos moves d2d3 c7c5 d1d2 b7b6
2018-04-03 07:05:10,391<--1:Could not write message to log file: < go wtime 116048 btime 111825 winc 0 binc 0 movestogo 38
2018-04-03 07:05:13,760<--1:Could not write message to log file: PV: [Ng1f3, aa7a6, Bb5a4, Bc8g4, Na3c4, Nf6h5]
2018-04-03 07:05:13,760<--1:Could not write message to log file: > bestmove g1f3
2018-04-03 07:05:13,760<--1:bestmove g1f3
2018-04-03 07:05:13,7601Zug gefunden:Sg1-f3
2018-04-03 07:05:18,9711Start calc, move no: 6
2018-04-03 07:05:18,971-->1:position startpos moves d2d3 c7c5 d1d2 b7b6 g1f3 c8b7
2018-04-03 07:05:18,971-->1:go wtime 112684 btime 107082 winc 0 binc 0 movestogo 37
2018-04-03 07:05:18,971<--1:Could not write message to log file: < position startpos moves d2d3 c7c5 d1d2 b7b6 g1f3 c8b7
2018-04-03 07:05:18,971<--1:Could not write message to log file: < go wtime 112684 btime 107082 winc 0 binc 0 movestogo 37
2018-04-03 07:05:22,060<--1:Could not write message to log file: PV: [Nc4e3, Bg4xf3, gg2xf3, Qd8f6, Ne3f5]
2018-04-03 07:05:22,060<--1:Could not write message to log file: > bestmove c4e3
2018-04-03 07:05:22,060<--1:bestmove c4e3
2018-04-03 07:05:22,0601---------> Arena:Illegaler Zug!: "c4e3" (Feinprüfung)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.