Coder Social home page Coder Social logo

agalassi / tablutcompetition Goto Github PK

View Code? Open in Web Editor NEW
23.0 8.0 25.0 1.47 MB

Software for the Tablut Students Competition

License: BSD 3-Clause "New" or "Revised" License

HTML 74.07% JavaScript 0.12% CSS 1.94% Java 23.86% Shell 0.01%
artificial-intelligence competition board-game tablut

tablutcompetition's Introduction

TablutCompetition

Software for the Tablut Students Competition

Installation on Ubuntu/Debian

From console, run these commands to install JDK 8 e ANT:

sudo apt update
sudo apt install openjdk-8-jdk -y
sudo apt install ant -y

Now, clone the project repository:

git clone https://github.com/AGalassi/TablutCompetition.git

Run the Server without Eclipse

The easiest way is to utilize the ANT configuration script from console. Go into the project folder (the folder with the build.xml file):

cd TablutCompetition/Tablut

Compile the project:

ant clean
ant compile

The compiled project is in the build folder. Run the server with:

ant server

Check the behaviour using the random players in two different console windows:

ant randomwhite

ant randomblack

At this point, a window with the game state should appear.

To be able to run other classes, change the build.xml file and re-compile everything

Replay function

Replay a game using the logfile

Example:

java -jar .\server.jar -g -R .\logs\PLAYER1_vs_PLAYER2_1652711382324_gameLog.txt

tablutcompetition's People

Contributors

agalassi avatar andreaterenz avatar danysan1 avatar federico-terzi avatar filloax avatar giuluck avatar lorisgiann avatar simone999 avatar thelillo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tablutcompetition's Issues

Unusual switch syntax

In ReplayServer.java, in the getStateFromLines(), the switch block uses an unusual syntax (-> instead of :, and lacks break commands), which is not compatible with Java 11

Mangiata re con trono

Ho notato che nella situazione in figura la mossa del nero C6 -> C5 non provoca la mangiata del re.

screenshot_1-1
screenshot_1-2

Nel seguente caso invece il re viene mangiato regolarmente.

screenshot_2-1
screenshot_2-2

Nel caso fosse utile allego anche i file di log delle due partite.

gameLog_1.txt
gameLog_2.txt

Giocatore Random rimane con una sola pedina: IllegalArgumentException

Giocando come giocatore Random alle linee 153 e 239 della classe TablutRandomClient Random.nextInt viene chiamato con argomento pawns.size() - 1 che risulta essere 0 essendoci solo una pedina rimasta.

Questo lancia una IllegalArgumentException: bound must be positive che fa perdere la partita al giocatore.

E' un problema secondario, e non relativo alle regole del gioco, ma volevo comunque segnalarlo.
Saluti

Bug relativi al "mangiare una pedina"

@AGalassi
Allego due screenshot per due possibili problemi.
Muovendo la pedina bianca da E3 a A3 ottengo che la pedina nera in posizione A4 viene mangiata (anche se l'accampamento di posizione A5 è coperto da una pedina nera). È un funzionamento corretto? Dalle regole delle slide non è chiaro se questo sia corretto o meno.
Schermata del 2019-04-08 12-45-08

Secondo "problema": se muovo la pedina nera da posizione E2 a E3 NON mangio la pedina bianca in posizione E4, questo è corretto? Dalle regole si evince che il castello "fa da sponda" indipendentemente dal fatto che il re sia dentro o fuori dallo stesso. È corretto? Allego schermata anche di questo.
Schermata del 2019-04-08 12-45-20

Problema nel nome del giocatore nero

Al nome del giocatore nero non viene applicata la funzione di cancellazione dei caratteri invalidi. Nell'esempio allegato la stringa che viene passata è sempre la stessa ma il server li gestisce in maniera diversa.
Schermata del 2019-05-22 16-58-31

Outdated README

  • the README proposes Java 8, but the String.strip() method is used in ReplayServer.java, which is only compatible with Java 11+
  • in the "Replay function" section of the README, it would be useful to also include the ant server-jar command, used to generate the server.jar file mentioned there

State.java hashCode broken

Two different istances of it.unibo.ai.didattica.competition.tablut.domain.StateTablut have equal values but different hashCodes.
The problems is in turn related to .hashCode() invoked on java matrix representing the board. This is because hashCode default implementation for Array is the same of Object!

Here's a junit5 test case to reproduce the problem:
TestHashCodeState.txt

Cattura di un pezzo

Non ho capito una cosa delle regole: il Trono funge da sponda indipendentemente dal colore della pedina che deve essere mangiata giusto?
L'accampamento invece funge da sponda solo per i Neri che mangiano oppure anche per i Bianchi?

Aggiornamento stato nella gui

Problema che non c'entra con le regole del gioco:

Lanciando da terminale un random contro uno human, abbassando la finestra della gui e continuando a giocare da terminale lo stato viene comunicato correttamente a entrambi i giocatori, ma la gui non viene aggiornata e anche rialzandola la situazione non cambia.
Lo faccio presente casomai qualcuno lo utilizzasse, ho provato anche random vs random e human vs human e mi pare che in quei casi non si verifichi questo problema.

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.