Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why is it crushing ?
#1
Hello guys i am totally new to python and programming at all
my first try was to make a simulator to the discord bot Tatsumaki fishing system but idk why is it keeps crushing
here is the code
import time
global coins
global common
global garbage
global uncommon
common = 0
uncommon = 0
garbage = 0
coins = 100
def start():
	print "Hello my friend!"
	name = raw_input("what's your name :")
	print "Welcome, "+ name + "!"
	print "This game is just like Tatsumaki Discord Bot fishing system, i hope that you enjoy it."
	print "the gole of the game is to collect as much fishs as possible then selling them for coins."
	print "Common fishs worth 12 coins/uncommon fishs worth 20 coins/garbage worth 8 coins."
	print "you have to pay 10 coins as a fee for fishing."

	choice = raw_input("Do you want to play Y/N ?:")
	if choice == "Y":
		print "To fish you have to use the command fish"
		begin()
	if choice == "N":
		print "Goodbye"
    	time.sleep(2)


def begin():
    global common
    global garbage
    global uncommon
    global coins  
    print "Let's start!"
    if coins > 500:
       print "You have won the game!"
       play = raw_input("Do you want to play again?:")
       if play == "Y":
          begin()
       if play == "N":
          print "Congrazts again"
          time.sleep(2)
    fish = raw_input("Do you want to fish ?:")
    if fish == "fish":
        print "You caught a common fish!"
        common=common+1
        coins=coins-10
        print "You currently have, "+common+"common fishs, "+uncommon+"uncommon fishs, "+garbage+"garbage fishs"
        print "your coins are now:"+coins
        begin()
    elif fish == "fish":
    	print "You caught an uncommon fish!"
        uncommon=uncommon+1
        coins=coins-10
        print "You currently have, "+common+"common fishs, "+uncommon+"uncommon fishs, "+garbage+"garbage fishs"
        print "your coins are now:"+coins
        begin()
    elif fish == "fish":
    	print "You caught a garbage fish!"
    	garbage=garbage+1
    	coins=coins-10
    	print "You currently have, "+common+"common fishs, "+uncommon+"uncommon fishs, "+garbage+"garbage fishs"
    	print "your coins are now:"+coins
    	begin()
    if fish == "N":
       sell = raw_input("Do you want to sell your fishs ? Y/N:")
       if sell == "Y":
          print "You currently have, "+common+"common fishs, "+uncommon+"uncommon fishs, "+garbage+"garbage fishs"
          print "You have sold your fishs."
          coins = common*12+uncommon*20+garbage*8
          common=0
          uncommon=0
          garbage=0
          print "your coins are now:"+coins
start()   		

it crushes when i get to this line
 fish = raw_input("Do you want to fish ?:")
i hope if you can help and thanks
note i am used sublime to write the code and github to launch it.
Reply


Messages In This Thread
why is it crushing ? - by Cheetos - Jan-26-2018, 01:29 PM
RE: why is it crushing ? - by j.crater - Jan-26-2018, 01:58 PM
RE: why is it crushing ? - by j.crater - Jan-26-2018, 02:14 PM
RE: why is it crushing ? - by Cheetos - Jan-26-2018, 02:17 PM
RE: why is it crushing ? - by j.crater - Jan-26-2018, 02:25 PM
RE: why is it crushing ? - by Cheetos - Jan-26-2018, 02:33 PM
RE: why is it crushing ? - by sparkz_alot - Jan-26-2018, 03:59 PM
RE: why is it crushing ? - by Cheetos - Jan-26-2018, 05:47 PM
RE: why is it crushing ? - by mepyyeti - Jan-26-2018, 06:17 PM
RE: why is it crushing ? - by league55 - Jan-26-2018, 05:34 PM
RE: why is it crushing ? - by DeaD_EyE - Jan-26-2018, 06:46 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020