GithubHelp home page GithubHelp logo

ivansowerby / rock-paper-scissors-ai Goto Github PK

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

A rock, paper, scissors "AI" which predicts the user's next move from a binomial distribution of the frequency of previous moves; with a CSV player database

License: MIT License

Python 100.00%
ai binomial-distribution game python python3 rock-paper-scissors

rock-paper-scissors-ai's Introduction

Rock Paper Scissors "AI"

Revision for 0.0.1

List of contents:

  1. Brief Introduction
  2. Instructions
  3. Console Example
  4. Legal (MIT license)

Brief Introduction


A Rock Paper Scissors game application written in Python; competing against an “AI” (named machine), which produces predictions by generating a random choice from a binomial distribution of the user’s frequency of previous inputs. Interfaced by CLI. With a player database to record statistics of performance over the duration of games.

  • All usernames in the CSV (Comma-Seperated Values) database are represented as hash_ids, which are simply the output of the SHA256 function in hexadecimal (32 characters), with an input of the username.

Instructions


Packages

Prior to being interpreted the following non-standard packages must be installed to the enviroment:

numpy
keyboard
cursor
  1. Clone (download) the repository locally.
  2. Change the pwd directory to the /src subdirectory.
  3. Enter pip3 install -r requirements.txt into a preferred CLI shell to download the necessary packages into the enviroment:

Play

  1. Change the pwd directory (if not already) to the /src subdirectory.
  2. Run play.py with the command python3 play.py
  3. Follow the instructions printed on the CLI:
    • Input a username (case-sensitive).
    • Use the left and right arrow keys (or a and d) to change between rock, paper and scissors.
    • Press enter (or e) to confirm your choice.

Console Example


username (case-sensitive): Ivan

Rock🪨, Paper📰, Scissors✂️

📰  Vs  📰  |  tie
✂️
username (case-sensitive): Ivan

Rock🪨, Paper📰, Scissors✂️

📰  Vs  📰  |  tie
✂️  Vs  📰  |  user
🪨  Vs  📰  |  machine

Final Score:
user: 1
machine: 1

-----------

Statistics:
win streak:
  -current: 0
  -highest: 0
win rate: N/A

-----------
Rock🪨, Paper📰, Scissors✂️

📰  Vs  🪨  |  user
🪨  Vs  🪨  |  tie
🪨  Vs  ✂️  |  user

Final Score:
user: 2
machine: 0

-----------

Statistics:
win streak:
  -current: 2
  -highest: 1
win rate: 0.5

-----------

License (MIT)



Permissions Conditions Limitations
Commercial use License and copyright notice Liability
Distribution Warranty
Modification
Private use
MIT License

Copyright (c) 2022 Ivan (GitHub: ivanl-exe, E-Mail: [email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

rock-paper-scissors-ai's People

Contributors

ivansowerby avatar

Stargazers

 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.