Giter Site home page Giter Site logo

chess's Introduction

README

chess's People

Contributors

fluxroot avatar murygin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

chess's Issues

Moving failed

dm vs. Flux, game-id: 40, cloudbees DB

2013-11-21 08:09:33,465 DEBUG http-8677-10 - Next move: h5h8
2013-11-21 08:09:33,466 DEBUG http-8677-10 - Calculated next move: h5h8
2013-11-21 08:09:33,466 DEBUG http-8677-10 - Processing new move: Qh5xh8, FEN: r1bqk2r/2pp4/p1p3p1/5p1Q/4n3/2P5/PPP2PPP/R1B1R1K1 w kq - 0 23, game-id: 40
2013-11-21 08:09:33,821 ERROR http-8677-10 - Moving failed:
java.lang.IllegalStateException
at de.schildbach.game.chess.ChessRules.castle(ChessRules.java:581)
at de.schildbach.game.chess.ChessRules.potentialMovesForSource(ChessRules.java:503)
at de.schildbach.game.common.ChessLikeRules.allowedMoves(ChessLikeRules.java:133)
at org.n2.chess.beans.RuleService.parsePosition(RuleService.java:56)
at org.n2.chess.beans.BoardBean.move(BoardBean.java:154)
at org.n2.chess.beans.GameBean.doMove(GameBean.java:272)
at org.n2.chess.beans.GameBean.calculateMove(GameBean.java:250)
at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at net.stax.appserver.webapp.RequestMonitorValve.invoke(RequestMonitorValve.java:35)
at net.stax.appserver.admin.StaxApplicationQueryValve.invoke(StaxApplicationQueryValve.java:49)
at net.stax.appserver.webapp.RequestSetupValve.invoke(RequestSetupValve.java:31)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:647)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)

Show Game History

Add the capability to switch through the game history. Clicking on a move in the move list shows the position after the move.

Moving failed

dm vs. Flux, game-id: 40, cloudbees DB

2013-11-21 08:09:33,465 DEBUG http-8677-10 - Next move: h5h8
2013-11-21 08:09:33,466 DEBUG http-8677-10 - Calculated next move: h5h8
2013-11-21 08:09:33,466 DEBUG http-8677-10 - Processing new move: Qh5xh8, FEN: r1bqk2r/2pp4/p1p3p1/5p1Q/4n3/2P5/PPP2PPP/R1B1R1K1 w kq - 0 23, game-id: 40
2013-11-21 08:09:33,821 ERROR http-8677-10 - Moving failed:
java.lang.IllegalStateException
at de.schildbach.game.chess.ChessRules.castle(ChessRules.java:581)
at de.schildbach.game.chess.ChessRules.potentialMovesForSource(ChessRules.java:503)
at de.schildbach.game.common.ChessLikeRules.allowedMoves(ChessLikeRules.java:133)
at org.n2.chess.beans.RuleService.parsePosition(RuleService.java:56)
at org.n2.chess.beans.BoardBean.move(BoardBean.java:154)
at org.n2.chess.beans.GameBean.doMove(GameBean.java:272)
at org.n2.chess.beans.GameBean.calculateMove(GameBean.java:250)
at sun.reflect.GeneratedMethodAccessor471.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:153)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:769)
at javax.faces.component.UICommand.broadcast(UICommand.java:300)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at net.stax.appserver.webapp.RequestMonitorValve.invoke(RequestMonitorValve.java:35)
at net.stax.appserver.admin.StaxApplicationQueryValve.invoke(StaxApplicationQueryValve.java:49)
at net.stax.appserver.webapp.RequestSetupValve.invoke(RequestSetupValve.java:31)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:647)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)

Add castling support

If the king is moving two squares towards a rook perform a castling.
Before performing the castling check if everything is valid:

  • king has never moved

  • rook involved has never moved

  • the squares between the king and the rook involved are not occupied

  • the king is not in check

  • the king does not cross over or end on a square in which it would be in check

    See http://en.wikipedia.org/wiki/Castling for more details.

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.