Giter VIP home page Giter VIP logo

jaiswalchitransh / snake-water-gun-game-in-python Goto Github PK

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

This Python script implements a Snake, Water, Gun game where the user competes against the computer. The user inputs their choice, and the program randomly selects a choice for the computer. The game function evaluates the choices, determining the winner based on predefined rules.

Python 100.00%
game python python3 snakewatergun-game project python-3 game-development

snake-water-gun-game-in-python's Introduction

Snake Water Gun Game in Python

Table of Contents

Project Overview

The Snake, Water, Gun game implemented in Python allows a user to play against the computer. It's a simple hand game where choices (Snake, Water, Gun) determine the outcome based on predefined rules.

Installation

This project requires Python 3.12.1 or later. To set up the project:

  1. Ensure Python 3.12.1 or a later version is installed on your system. You can download Python from python.org.

  2. Clone or download the repository to your local machine.

      git clone https://github.com/jaiswalchitransh/Snake-Water-Gun-Game-in-Python.git
    
  3. Open the project in your preferred Python environment (e.g., IDE or terminal).

  4. Run the script (game.py) and observe the output.

Usage

Run the script:

  python game.py

Follow the prompts to enter your choice (0 for Snake, 1 for Water, 2 for Gun) when prompted.

Features

  • Random Selection: The computer randomly selects its choice (Snake, Water, Gun).
  • Outcome Determination: The game function compares the user's choice against the computer's choice and determines if the user won, lost, or it's a draw.
  • Score Representation: Returns 0 for a draw, -1 for a loss, and 1 for a win.
  • User Interaction: Provides clear feedback on the user's choice, the computer's choice, and the game result.

Contribution

I, Chitransh Jaiswal developed this Project Individually. I was responsible for all aspects of the project, including design, development, testing, and documentation. Contributions to improve the efficiency, readability, or functionality of the code are welcome. To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add some feature').
  5. Push to the branch (git push origin feature/your-feature).
  6. Create a new Pull Request.

Please ensure your contributions adhere to the coding standards and follow the existing style and structure.


Thank you for your interest in the Snake, Water, Gun Game!

snake-water-gun-game-in-python's People

Contributors

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