Skip to content

Releases: AbhijeetKumar1505/python

Grock_Proxy

Choose a tag to compare

@AbhijeetKumar1505 AbhijeetKumar1505 released this 03 Mar 05:53
974b787
Initial commit

Snake Water and Gun Game

Pre-release

Choose a tag to compare

@AbhijeetKumar1505 AbhijeetKumar1505 released this 04 Sep 07:25
974b787

This is my first project during my AI journey. It's a game called "Snake, Water, and Gun, " also known as "Stone, Paper, and Scissors," a childhood memory for me.

Full Changelog: https://github.com/AKsince2005/python/commits/virtualenv

`
'''
1 for snake
-1 for water
0 for gun

'''

def select(c):
c = input("Would you like to continue this game : ")
return c

import random

selection = "YES"

while (selection == "YES"):
print("Choose : \nS for Snake\tW for Water\tG for Gun")
choice = random.choice([-1, 0, 1])

computer = choice
youstr = input ("Enter your choice : ")
youstr=youstr.upper()
youdict = {"S":1,"W":-1,"G":0}
if youstr in youdict:
    

    you = youdict[youstr]
    reversedict = {1:"Snake", -1 : "Water" , 0 : "Gun"}

    print(f"You chose {reversedict[you]} \n Computer chose {reversedict[computer]}")

    if computer == -1 and you == 1:
        print("You win!")
        
    elif computer == -1 and you == 0:
        print("You lose!")
        
    elif computer == 1 and you == -1:
        print("You lose!")
        
    elif computer == 1 and you == 0:
        print("You win!")
        
    elif computer == 0 and you == -1:
        print("You win!")

    elif computer == 0 and you == 1:
        print("You lose!")

    elif computer == you:
        print("It's a tie!")

    else:
        print("Invalid input")
    selection = select(c="")
    selection = selection.upper()
    if selection == "YES":
        continue
    else:
        print("Thanks! for playing come soon............... ")
        break
else:
    print("Invalid choice : \n Retry")
    selection = select(c="")
    selection = selection.upper()
    if selection == "YES":
        continue
    else:
        print("Thanks! for playing come soon............... ")
        break

`

Recording.2024-09-04.124819.mp4

Perfect guess Game

Perfect guess Game Pre-release
Pre-release

Choose a tag to compare

@AbhijeetKumar1505 AbhijeetKumar1505 released this 13 Sep 18:15
974b787

Perfect Guess

"Perfect Guess" is a simple yet engaging number-guessing game where your challenge is to find the secret number between 1 and 100. The game randomly selects a number, and your task is to guess it in as few attempts as possible. After each guess, you'll receive a hint—whether to guess higher or lower—bringing you closer to the correct answer.

If you're spot on, the game will congratulate you, letting you know how many attempts it took. Feeling competitive? Try to beat your previous score by guessing the number in fewer attempts. You can play as many rounds as you like, but if you wish to stop, simply type "0" to exit the game.

Features:

Random number selection between 1 and 100.
Hints provided after each guess to guide you.
Unlimited attempts with feedback on performance.
Option to exit the game at any time.
Simple and intuitive gameplay, perfect for quick fun or a longer challenge.
Test your intuition, refine your guessing skills, and see if you can achieve the perfect guess!

`import random

command = "START"

while command != "EXIT":
n = random.randint(1, 100)
guesses = 0
a = None

while a != n:
    
    a = int(input("Guess the Number (or type '0' to exit): "))
    if a == 0:
        print("Exiting the game.")
        command = "EXIT"
        break
    guesses += 1
    if a not in range(1,101):
        print("Invalid input. Please enter a valid number.")
        break
    if a > n:
        print("Lower number please!")
    elif a < n:
        print("Higher number please!")

if a == n:
    print(f"Congratulations! You've guessed the number {n} correctly in {guesses} attempts.")

if command != "EXIT":
    choice = input("Do you want to play again? (YES/NO): ").upper()
    if choice != "YES":
        command = "EXIT"

print("Thank you for playing!")
`

Screen.Recording.2024-09-13.233411.mp4

Full Changelog: https://github.com/AKsince2005/python/commits/#fun-project