Giter Site home page Giter Site logo

cs5130-webchess's Introduction

chess

A re-frame application designed to play chess in the browser.

Development Mode

Run application:

Run lein serv in one terminal (to start the server) and then lein dev to start shadow-cljs.

shadow-cljs will automatically push cljs changes to the browser.

Wait a bit, then browse to http://localhost:8280.

Production Build

Start the chess server:

lein serv

Compile the client app:

lein prod

Test the client app:

Open resources/public/index.html in your browser.

TODO

  • HTTP interface
    • Right now, we use WebSockets for everything, but we should only use them for game logic, and implement other systems (like joining a game, fetching the list of games) as a REST interface.
  • Routing for the client.
    • We should be generating page content based on the URL whenever possible, so that the back/forward/refresh buttons behave as expacted, and so that players can share links to games.
  • Detect checkmate and end game immediately if so
  • One player leaving a game shouldn't immediately destroy it, but rather re-enter it into the list of games
    • This requires supporting clients entering a game that may be in-progress.

Technical Debt

  • "Bad selection" animations are implemented outside of the React lifecycle
    • Currently this is done with a CSS animation and a JS setTimeout that sets the tile's style after the animation is finished.
      • This is prone to async bugs, and is currently causing an issue where the invalid selection animation cannot be played twice in a row for the same tile (because the app db doesn't change, re-frame doesn't re-draw the board for the second click).
      • Reanimated might be a good candidate for fixing this, but we need to make sure we're not tanking performance by re-drawing board repeatedly!
  • Clean up the chess engine code significantly
    • Pieces should not need IDs.
      • valid-moves shouldn't need the whole board history.
      • valid-moves, check?, etc., shouldn't need a reference to a rules object.
      • en-passant being an optional rule should be a special case if that's what we want.
      • clean up valid-moves to be more readable.
  • Undo requests should include what board state the requesting client thinks the game is in
    • The server should respond reasonably if a stale client requests an undo for a board state that has already been surpassed.

cs5130-webchess's People

Contributors

bmourad01 avatar cfinegan avatar

Watchers

 avatar  avatar

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.