Giter Site home page Giter Site logo

rps_online's Introduction

Rock-Paper-Scissors Web App

This project is part of an article that proposes to study the results of the interaction of two players from the perspective of Game Theory and Chaotic Dynamic Systems. This is a web application that allows two players to play rock-paper-scissors against each other in real time using Flask and Flask-SocketIO. Users can sign up for an account, log in, view the leaderboard, and change their username.

Installation

To use this application, follow these steps:

  • Clone the repository to your local machine

  • Set the environment variable SECRET_KEY to a .env file in the project root: SECRET_KEY=YOUR_SECRET_KEY

  • Install Docker and Docker-compose

  • run in your terminal:

docker-compose up --build

Usage

Login/Logout

Users can log in by entering their username and password on the login page. If they do not have an account, they can sign up for one on the registration page. Once logged in, users can access their profile page, view the leaderboard, and play rock-paper-scissors against other users.

Users can log out by clicking the "Sign out" button on their profile page.

Profile Page

The profile page displays the user's current username, number of wins, and rank on the leaderboard. Users can change their username by entering a new one in the form provided and clicking the "Save Changes" button.

Leaderboard

The leaderboard displays all users in the database sorted by number of wins in descending order.

Playing Rock-Paper-Scissors

To play rock-paper-scissors against another user, the user must first join a room by entering the room code on the lobby page. If a room with the given code does not exist, one will be created. Once two users have joined the same room, they can start playing rock-paper-scissors.

Each user selects their move by clicking on the corresponding button on the game screen. The winner of each round is displayed on both users' screens. The game ends when one user has won a predetermined number of rounds.

License

This project is licensed under the MIT License

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.