# imports import random import utils import math import re run = True while run == True: # input command = input("\n") # lists outputsHunt=[ "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a garoup of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "While exploring you find a group of shiny rocks. CRYSTALS!!! You found {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "A good friend has gifted you {20} crystals!", "You have dug up {20} crystals!", "You have dug up {20} crystals!", "You have dug up {20} crystals!", "You have dug up {20} crystals!", "You have dug up {20} crystals!", "Hard work pays off! You found {20} crystals!", "Hard work pays off! You found {20} crystals!", "Hard work pays off! You found {20} crystals!", "Hard work pays off! You found {20} crystals!", "Hard work pays off! You found {20} crystals!", "You found a cave FILLED with crystals!!! You have gotten {1000} crystals!", "Your boss has been nice to you today and gave you {250} crystals!", "Your boss has been nice to you today and gave you {250} crystals!", "You started selling some of your broken supplies and to your amazement earn {250} crystals!", "You started selling some of your broken supplies and to your amazement earn {250} crystals!", "You found a sack of crystals just laying on the ground! A free {250} crystals!", "You find an abandoned minecart with a bag of {250} crystals in it.", "A homeless man gives you {250} crystals! (wait isn't it supposed to be the other way around?)", "A homeless man gives you {250} crystals! (wait isn't it supposed to be the other way around?)", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice.", "Hey look! Its a bush! There are {10} crystals in it! Noice." , "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You climb a tree for no reason and find {10} crystals. I N T R E S T I N G.", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You attempt to chop a giant crystal out of the mountainside but you only manage to grab {10}. I feel bad for you :(", "You went into a cave and woke up a sleeping bear! Bad idea mate... you died.", "You find a river with crystals at the bottom but just then an angry guy charges at you with a shovel and you run for your life. You lost {60} crystals.", "You find a river with crystals at the bottom but just then an angry guy charges at you with a shovel and you run for your life. You lost {60} crystals.", "You find a river with crystals at the bottom but just then an angry guy charges at you with a shovel and you run for your life. You lost {60} crystals.", "You find a river with crystals at the bottom but just then an angry guy charges at you with a shovel and you run for your life. You lost {60} crystals.", "You find a river with crystals at the bottom but just then an angry guy charges at you with a shovel and you run for your life. You lost {60} crystals.", "You bumped into a mean person, who pickpockets you. You find out later that you lost {60} crystals.", "You bumped into a mean person, who pickpockets you. You find out later that you lost {60} crystals.", "You bumped into a mean person, who pickpockets you. You find out later that you lost {60} crystals.", "You bumped into a mean person, who pickpockets you. You find out later that you lost {60} crystals.", "You bumped into a mean person, who pickpockets you. You find out later that you lost {60} crystals.", "You were hiking in the wilderness and accidentally dropped your bag of crystals!!! You lost {150} crystals.", "You were hiking in the wilderness and accidentally dropped your bag of crystals!!! You lost {150} crystals.", "You were hiking in the wilderness and accidentally dropped your bag of crystals!!! You lost {150} crystals.", "You tripped, and almost fell off a cliff! Luckily, you only lost {150} crystals.", "You tripped, and almost fell off a cliff! Luckily, you only lost {150} crystals.", "You tripped, and almost fell off a cliff! Luckily, you only lost {150} crystals.", "You tripped, and almost fell off a cliff! Luckily, you only lost {150} crystals.", "you find a bear, and franticly run away. In the process, You lost {150} crystals.", "you find a bear, and franticly run away. In the process, You lost {150} crystals.", "you find a bear, and franticly run away. In the process, You lost {150} crystals.", "You tripped on a rock and shattered a few crystals. You lost {50} crystals", "You tripped on a rock and shattered a few crystals. You lost {50} crystals", "You tripped on a rock and shattered a few crystals. You lost {50} crystals", "You tripped on a rock and shattered a few crystals. You lost {50} crystals", "You accidentally dropped {50} crystals.", "You accidentally dropped {50} crystals.", "You accidentally dropped {50} crystals.", "You give your friend {50} crystals.", "You give your friend {50} crystals.", "You give your friend {50} crystals.", ] outputsDig=[ "dig" ] outputs=[outputsHunt, outputsDig] #hunt def hunt(): return(random.sample(outputsHunt, k = 1)) # dig def dig(): print("diging") # bet def bet(): numBot=["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] numUser=["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"] print("Your Number:") print(random.sample(numUser, k = 1)) print("The bot's Number:") print(random.sample(numBot, k = 1)) if numBot < numUser: print("You have won!") if numBot > numUser: print("The bot has won!") # bal def bal(): x = 0 y = re.findall('[0-1000]+', str(cmdHunt)) # y = 100 bal = x+y x = bal if bal == 1: print("Your have " + str(bal) + " crystal!") else: print("Your have " + str(bal) + " crystals!") # run def run_commands(): # call functions if command == "!hunt": cmdHunt=hunt() print(cmdHunt) if command == "!dig": dig() if command == "!bet": bet() if command == "!bal": cmdHunt=hunt() bal() # command aliases if command == "!h": cmdHunt=hunt() print(cmdHunt) if command == "!d": dig() if command == "!b": bet() if command == "!bank": cmdHunt=hunt() bal() if command == "!crystals": cmdHunt=hunt( bal() if command == "!c": bal() run_commands()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question