Commit graph

1 commit

Author SHA1 Message Date
Felix
3868664905
Create devcontainer.json
import random

def play_game():
    # 1. Setup the initial state
    inventory = ["Flashlight"]
    hp = 100
    
    print("--- Ghost Hunter: Inventory Edition ---")
    print(f"You start your hunt with: {inventory}")
    
    # Scene 1: Finding an item
    print("\nExploring the old cabin, you see a jar of [SALT] on a shelf.")
    action = input("Do you take it? (YES/NO): ").strip().upper()
    
    if action == "YES":
        inventory.append("Salt")
        print(f"Inventory updated: {inventory}")
    
    # Scene 2: The Ghost Encounter
    print("\nA spirit blocks the exit! Its eyes glow red.")
    
    if "Salt" in inventory:
        print("\nYou quickly throw the Salt on the floor, creating a barrier!")
        print("The ghost cannot cross. You escape safely. YOU WIN!")
    else:
        print("\nYou have nothing to protect yourself!")
        damage = random.randint(50, 80)
        hp -= damage
        print(f"The ghost strikes! You took {damage} damage. HP is now {hp}.")
        if hp <= 0:
            print("You didn't survive the night...")
        else:
            print("You crawled away, but the haunt continues...")

if __name__ == "__main__":
    play_game()
2026-05-09 21:05:31 +01:00