go-ethereum/.devcontainer/devcontainer.json
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

36 lines
1.4 KiB
JSON

{def start_hunt():
print("--- Forest Ghost Mysteries: The Close Call ---")
print("You are deep in the Blackwood Forest with your thermal camera.")
print("Suddenly, the temperature drops and a faint whisper calls your name...")
# First Choice
choice1 = input("\nDo you [RUN] back to the van or [INVESTIGATE] the sound? ").strip().upper()
if choice1 == "INVESTIGATE":
investigate_path()
elif choice1 == "RUN":
print("\nYou trip over a root in the dark! The ghost catches up. Game Over.")
else:
print("\nIndecision is fatal in the forest. The ghost disappears, and so do you.")
def investigate_path():
print("\nYou shine your light toward an ancient oak tree.")
print("A shadowy figure emerges! It's a Ghost Attack!")
# Second Choice
choice2 = input("\nDo you use your [SALT] circle or try to [TALK] to it? ").strip().upper()
if choice2 == "SALT":
print("\nThe ghost recoils from the salt barrier! You survived the close call.")
print("CONGRATULATIONS, GHOST HUNTER!")
elif choice2 == "TALK":
print("\nThe ghost wasn't looking for a conversation. You've been haunted! Game Over.")
else:
print("\nYou froze in fear. The mystery of the forest remains unsolved.")
# This line starts the game
if __name__ == "__main__":
start_hunt()
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {}
}