Giter VIP home page Giter VIP logo

scrobburl's Introduction

Scrobburl

A multiplayer word game where all state is stored in the URL (no backend needed!). Just send a link to your opponent after each turn.

Why store state in the URL?

Aside from doing it for the sake of curiosity, there are some practical benefits to doing this versus having a dedicated server:

  • It's easier to host - the entire game is just some static files, so it can be hosted easily on a static hosting platform (I'm using GitHub Pages) without needing to run any code on the backend or use a database.
  • Users don't need to log in or create accounts.
  • It's decentralized - use whatever mechanism you want to send links to your opponents (email, SMS, etc).

How do you prevent cheating?

Right now, the implementation doesn't do a whole lot to prevent cheating in the form of RNG prediction/manipulation. However, it's not possible for a player to cheat by modifying the score counters or playing illegal moves. This is because the game state is actually stored as a list of all turns so far, so the opponent can easily re-compute the final state and verify that all moves were valid.

My original idea for this project was to take it a step further, and use cryptographic techniques to ensure that players can't view their opponents tiles or predict what tiles they'll get next. I haven't gotten around to actually implementing this yet though ๐Ÿ˜ƒ.

Development

To run the app for development, open the dev container with VSCode, then press ctrl+shift+P and search for "Run build task". This will start the app on port 8000. The build task is defined in ./vscode/tasks.json.

Notes:

  • To make the dev server accessible from another device on the same network, change the Local Port Host setting in VSCode to allinterfaces.
  • If you're using Windows, make sure to clone the repo into your WSL file system, otherwise the elm-live file watcher won't work. Alternatively, you can probably do everything in Windows directly, but I haven't tested that.

scrobburl's People

Contributors

jcparkyn avatar

Stargazers

 avatar  avatar  avatar  avatar  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.