agalassi / tablutcompetition Goto Github PK
View Code? Open in Web Editor NEWSoftware for the Tablut Students Competition
License: BSD 3-Clause "New" or "Revised" License
Software for the Tablut Students Competition
License: BSD 3-Clause "New" or "Revised" License
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
Ho notato che nella situazione in figura la mossa del nero C6 -> C5 non provoca la mangiata del re.
Nel seguente caso invece il re viene mangiato regolarmente.
Nel caso fosse utile allego anche i file di log delle due partite.
In ReplayServer, there is a call on a supposed State.Pawn.fromString()
method, but it is not implemented in State.Pawn
Pare non sia possibile abilitare la GUI del server se compilato tramite Ant
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.
Con il re in F5, una nera in F4, l'altra in G5 e spostando l'ultima nera da G6 a F6 la cattura del re non viene comunicata e la partita continua, allego i log di seguito.
Specifico che l'errore si è presentato nonostante abbia fatto la pull delle modifiche apportate inerenti a un errore simile di poco tempo fa.
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?
@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.
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.
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
Commit ccc748c causes a NullPointerException to be thrown when checking the move at line 519. This is due to tin
being null
since the switch-case block which included the assignement to Turnwhite
or Turnblack
was moved after said line.
To replicate the behaviour run the server and two random players.
String.strip()
method is used in ReplayServer.java, which is only compatible with Java 11+ant server-jar
command, used to generate the server.jar file mentioned thereGiocando 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.