Skip to content

Ankit0830/Water_Snake_Gun_Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Snake Water Gun Game

A simple Python command-line game that pits the player against the computer in a classic Snake-Water-Gun match.

How it works

  • The computer randomly chooses one of: Snake, Water, or Gun.
  • The player enters a choice using a single letter:
    • S for Snake
    • W for Water
    • G for Gun
  • The program compares the player and computer choices, then prints the result.

Rules

  • Snake beats Water
  • Water beats Gun
  • Gun beats Snake
  • Same choice results in a draw

Run the game

python main.py

When prompted, type S, W, or G and press Enter.

Example

Enter your choice: S
You chose: Snake
Computer chose: Gun
You Lose!

Notes

  • The game uses random.choice to make the computer selection.
  • Input must be exactly S, W, or G.
  • Invalid input will raise a KeyError because the code does not currently handle unexpected entries.

About

A simple Python-based Snake Water Gun game where the user plays against the computer using random choice logic. Demonstrates basic concepts like conditionals, dictionaries, and user input.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages