GithubHelp home page GithubHelp logo

pimlu / connect4 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 24 KB

Online multiplayer connect 4 game. Runs in a single page without any JS tags

License: MIT License

JavaScript 81.25% HTML 18.75%

connect4's Introduction

Connect 4

This is an online multiplayer Connect 4 game written as a technical experiment.

It's actually a "single-page app" but it doesn't use a single JS tag. The way it does this is sort of convoluted.

Usage

npm install
npm start

Technical Details

The entire page is actually loading the whole time you play, and the server decides what the page content will be as the page loads. This means only new tags can be added - nothing in the DOM can be removed or changed. Content is retroactively changed anyway by overwriting past CSS with new <style> tags. The server can tell when you click without switching to another page by using CSS :active selectors with background set to a fake image URL. Normally, the browser would not make another request upon a second click, so it sends another style tag with a different :active URL each time a click happens. The page finally finishes loading when someone wins or loses.

Difficulty Settings

To play this on extra-hard mode, run wget -qO- http://localhost:1337/.

connect4's People

Contributors

pimlu avatar

Stargazers

Seth T avatar

Watchers

 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.