SHARE
TWEET

yan na btch

a guest Sep 15th, 2019 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. import time
  3. from datetime import date
  4. def randomNumber(rangeNum, modeCount):
  5.     randomNum = []
  6.     randomNum.clear()
  7.     for num in range(50):
  8.         random1 = random.randint(1, modeCount)
  9.         if randomNum.count(random1) > 0:
  10.             randomNum.remove(random1)
  11.         elif len(randomNum) == rangeNum:
  12.             break
  13.         else:
  14.             randomNum.append(random1)
  15.     return randomNum
  16. def game(gameModes, counts, price, prevWin, countMode):
  17.     global priceAll
  18.     lotto = []
  19.     print("-------------------------------------Welcome to "+gameModes+" Lotto--------------------------------------", "\nLotto price money: " + str(price))
  20.     for num in range(1000):
  21.         count = len(lotto)
  22.         if count < 1:
  23.             number = int(input("Enter a number("+str(counts + 1)+"): \n"))
  24.         else:
  25.             number = int(input("Enter next number("+str(counts + 1 - count)+"): \n"))
  26.         if lotto.count(number) > 0:
  27.             print("ERROR! Cannot enter the same value")
  28.         elif number > countMode:
  29.             print("ERROR! Cannot enter number higher than "+str(countMode))
  30.         elif number <= 0:
  31.             print("ERROR! Cannot enter number less than 1")
  32.         elif count >= counts:
  33.             lotto.append(number)
  34.             print("------------------------------------------------------------------------------------------------\n" + "Here are your entered number: " + str(lotto), "\nWinning balls are shuffling...")
  35.             time.sleep(2)
  36.             print("Here are winning numbers!!", str(prevWin), "\n------------------------------------------------------------------------------------------------", "\nYour numbers: " + str(lotto), "\nWinning numbers: " + str(prevWin))
  37.             time.sleep(2)
  38.             if str(prevWin) == str(lotto):
  39.                 print("YOU WIN!")
  40.                 if counts == 2:
  41.                     priceAll = 10000
  42.                 elif counts == 5:
  43.                     priceAll = 1000
  44.                 print("Curent price: " + str(priceAll))
  45.                 time.sleep(2)
  46.             else:
  47.                 priceAll = price + 500
  48.                 print("------------------------------------------------------------------------------------------------\n" + "AW SNAP! TRY AGAIN NEXT TIME!!", "\nCurent price: " + str(priceAll))
  49.                 time.sleep(2)
  50.             ask = input("------------------------------------------------------------------------------------------------\n" + "Try Again? (Y/N)\n")
  51.             if ask == "Y" or ask == "y":
  52.                 return price
  53.             elif ask == "N" or ask == "n":
  54.                 exit()
  55.         elif number <= countMode:
  56.             lotto.append(number)
  57.         print(lotto)
  58. def main():
  59.     print("--------------------------------------Welcome to IT-Lotto!--------------------------------------")
  60.     a = 1
  61.     price642, price645, price649, price3 = 1000, 1000, 1000, 10000
  62.     while True:
  63.         print("------------------------------------------------------------------------------------------------"+"\nYesterday's Winning numbers:")
  64.         if a == True:
  65.             print("In 6/42: ",randomNumber(6,42)," Price: ",price642,"\nIn 6/45: ",randomNumber(6,45)," Price: ",price645, "\nIn 6/49: ",randomNumber(6,49)," Price: ",price649, "\nIn Lucky Three: ",randomNumber(3,9),"Price: ",price3)
  66.         else:
  67.             print("In 6/42: ", str(prevWin1), " Price: ", price642, "\nIn 6/45: ", str(prevWin2), " Price: ", price645, "\nIn 6/49: ", str(prevWin3), " Price: ", price649, "\nIn Lucky3: ", str(prevWin4), "Price: ", price3)
  68.         today = date.today()
  69.         prevWin1, prevWin2, prevWin3, prevWin4 = randomNumber(6, 42), randomNumber(6,45), randomNumber(6,49), randomNumber(3, 9)
  70.         mode = int(input("----------------------------------- Today's date:"+ str(today)+ "-------------------------------------" +"\nSELECT PLAYING MODE:"+"\n(1) - 6/42 Lotto (2) - 6/45 Mega Lotto (3) - 6/49 Super Lotto (4) - Lucky Three Numbers :\n"))
  71.         if mode == 1:
  72.             game("6/42", 5, price642, prevWin1,42)
  73.             price642 = priceAll
  74.         elif mode == 2:
  75.             game("6/45", 5, price645, prevWin2,45)
  76.             price645 = priceAll
  77.         elif mode == 3:
  78.             game("6/49", 5, price649, prevWin3,49)
  79.             price649 = priceAll
  80.         elif mode == 4:
  81.             game("Lky3", 2, price3, prevWin4,9)
  82.             price3 = priceAll
  83.         a = False
  84. main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top