Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: cp1252 -*-
- import random
- import time
- cash = 500;
- def potatiswin():
- print "Du fick 3 potäter i rad"
- print "+ 25 $"
- global cash
- cash = cash + 25;
- start()
- def morotwin():
- print "Du fick 3 morötter i rad"
- print "+ 20 $"
- global cash
- cash = cash + 20;
- start()
- def gurkawin():
- print "Du fick 3 gurkor i rad"
- print "+ 15 $"
- global cash
- cash = cash + 15;
- start()
- def start():
- print "Du har nu", cash ,"$"
- youwannaplay()
- def youwannaplay():
- eee = raw_input("Sätt in 10$ i maskinen för att börja (Enter) ")
- if eee == "":
- print '-10 $'
- game()
- elif cash < 10:
- print 'Du har spelat bort alla dina pengar, dags för en paus?'
- else:
- print "Invalid input"
- start()
- def game():
- global cash
- cash = cash - 10
- w1 = ["","",""]
- w2 = ["","",""]
- w3 = ["","",""]
- r1 = random.randint(0,2)
- r2 = random.randint(0,2)
- r3 = random.randint(0,2)
- if r1 == 0:
- w1[0] = "Potatis"
- w1[1] = "Morot"
- w1[2] = "Gurka"
- if r1 == 1:
- w1[0] = "Morot"
- w1[1] = "Gurka"
- w1[2] = "Potatis"
- if r1 == 2:
- w1[0] = "Gurka"
- w1[1] = "Potatis"
- w1[2] = "Morot"
- if r2 == 0:
- w2[0] = "Potatis"
- w2[1] = "Morot"
- w2[2] = "Gurka"
- if r2 == 1:
- w2[0] = "Morot"
- w2[1] = "Gurka"
- w2[2] = "Potatis"
- if r2 == 2:
- w2[0] = "Gurka"
- w2[1] = "Potatis"
- w2[2] = "Morot"
- if r3 == 0:
- w3[0] = "Potatis"
- w3[1] = "Morot"
- w3[2] = "Gurka"
- if r3 == 1:
- w3[0] = "Morot"
- w3[1] = "Gurka"
- w3[2] = "Potatis"
- if r3 == 2:
- w3[0] = "Gurka"
- w3[1] = "Potatis"
- w3[2] = "Morot"
- print w1
- time.sleep(1.5)
- print w2
- time.sleep(1.5)
- print w3
- time.sleep(1.5)
- if (w1[0] and w2[0] and w3[0]) == ("Potatis"):
- potatiswin();
- elif (w1[0] and w2[0] and w3[0]) == ("Morot"):
- morotwin();
- elif (w1[0] and w2[0] and w3[0]) == ("Gurka"):
- gurkawin();
- elif (w1[1] and w2[1] and w3[1]) == ("Potatis"):
- potatiswin();
- elif (w1[1] and w2[1] and w3[1]) == ("Morot"):
- morotwin();
- elif (w1[1] and w2[1] and w3[1]) == ("Gurka"):
- gurkawin();
- elif (w1[2] and w2[2] and w3[2]) == ("Potatis"):
- potatiswin();
- elif (w1[2] and w2[2] and w3[2]) == ("Morot"):
- morotwin();
- elif (w1[2] and w2[2] and w3[2]) == ("Gurka"):
- gurkawin();
- elif (w1[0] and w2[1] and w3[2]) == ("Potatis"):
- potatiswin();
- elif (w1[0] and w2[1] and w3[2]) == ("Morot"):
- morotwin();
- elif (w1[0] and w2[1] and w3[2]) == ("Gurka"):
- gurkawin();
- elif (w1[2] and w2[1] and w3[0]) == ("Potatis"):
- potatiswin();
- elif (w1[2] and w2[1] and w3[0]) == ("Morot"):
- morotwin();
- elif (w1[2] and w2[1] and w3[0]) == ("Gurka"):
- gurkawin();
- else:
- print "Ingen vinst"
- start()
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement