Code Monkey home page Code Monkey logo

rpsxtreme's Introduction

rpsXtreme

I had this Idea some time ago where one simple change of rules to Rock Paper Scissors would make a tournament possibly hilarious.

  • The winner of a match gains the move his or her opponent lost with. The opponent loses this move as well.

So, for a tournament it is possible that the finale would end due to loss of possible moves.

In short I have here made a mock up in python 3 of the game, a client and server for a network based tournament.

Rules and definitions

  • A turn is one standard game of rock paper scissors.
  • A match is set of 5 turns.
  • A player starts with 1 rock, 1 paper, 1 scissors.
  • A player is not allowed to use a move if he or she has zero or less moves of this kind left.
  • A player loses if the player has no moves left.

Points

  • A player gains 10 points for a won match.
  • A player gains 2 points for a tied match.
  • A player gains 2 points for a won turn.
  • A player gains 1 point for a tied turn.
  • A player never loses points.

Additional rules

Alternative rules has been discussed en masse, some of them reaches this list

  • Giving a player a random move at the beginning of each match (or turn).
  • There should be a, usable only once, "nuke move" for each player to overrule original match outcome and make sure you win that turn.

Server and client

What first seemed to be a stupid idea evolved even further. I have a raspberry pi and figured I should make this game into some online rpsxtreme game, because rpsXtreme is super fun.

The main idea is that the server is responsible for matching 2 users, using the client, and let them play one match. Matches are run on the server, not with the client. When a match is over, the users can request to play one more with another random user.

Both client and server make use of python's socket module.

Client

I have been thinking of implementing a graphical user interface to be used instead of a terminal. But right now, I focus on a client for use in a terminal. First things first, you know?

Where it's at now:

  • Client connects to server.
  • Client requests a match.
  • Client receives snapshots of the match.
  • Client answers to Move requests from server.
  • Client now asks for user input.

Server

Where it's at now:

  • Server opens socket for everyone. Everyone.
  • Server connects with client.
  • Server responds to match request and starts a new bot match.
  • Server sends snapshots of the match to correct client.
  • Server can send snapshots of up to 9 turns before client crashes and that crash crashes the server. But it's OK, we don't need more than 5 turns :D (Crash occurs sincesend-limit is exceeded)
  • Server can now handle the client!

Known bugs

  • The server can be set in an inifite loop if you play really really good and empty the bots chocies.

rpsxtreme's People

Contributors

iambullsaw avatar

Stargazers

Niklas Nson avatar

Watchers

Niklas Nson avatar James Cloos avatar  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.