Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import time
- import webbrowser
- from datetime import date
- import os
- botName = "NiBBot"
- botAge = "1 year old"
- botAdress = "Inside the internet"
- botBirthDate = "Today"
- yourName = "John Mark S. Payas"
- yourNickName = "John"
- yourAge = "16 years old"
- yourAdress = "Old Boso-Boso Brgy. San Jose Antipolo City"
- yourBirthDate = "September 30, 2000"
- userChat = ""
- chat = ""
- def RPS():
- computer = random.randint(1,3)
- pscore = 0
- cscore = 0
- print("Rock, Paper, Scissor")
- pname = input("Player name: ")
- cname = input("Computer name: ")
- rounds = int(input("Best of: "))
- print("Let the battle begin")
- print(pname, " vs ", cname)
- print("Player Score: ",pscore, "Computer Score: ",cscore)
- print("Choose:", "\n1. Rock ", "\n2. Paper" , "\n3. Scissor")
- iter = 0
- while (rounds >= iter):
- choice = int(input("Choose: "))
- if choice == 1:
- if computer == 2:
- print("Computer choose: Paper")
- print("Computer Wins!")
- cscore += 1
- print(pname, " score: ",pscore , cname, " score: ", cscore)
- iter += 1
- else:
- print("Computer choose: Scissor")
- print("Player Wins!")
- pscore += 1
- print(pname, " score: ",pscore , cname, " score: ", cscore)
- iter += 1
- elif choice == 2:
- if computer == 3:
- print("Computer choose: Scissor")
- print("Compute Wins")
- cscore += 1
- print(pname, " score: ",pscore , cname, " score: ", cscore)
- iter += 1
- else:
- print("Player Wins!")
- pscore += 1
- print(pname, " score: ",pscore , cname, " score: ", cscore)
- iter += 1
- elif choice == 3:
- if computer == 1:
- print("Computer choose: Rock")
- print("Player Wins!")
- pscore += 1
- print(pname, " score: ",pscore , cname, " score: ", cscore)
- iter += 1
- else:
- print("Computer Wins!")
- cscore += 1
- print(pname, " score: ",pscore , cname, " score: ", cscore)
- iter += 1
- else:
- print("Congratulations, ", "\nFinal Score : ", pname, " ", pscore, " ", cname, " ", cscore)
- again = input("Do you want to continue? [Y]yes [N]no:")
- round +=1
- if(again == "Y"):
- iter = 0
- else:
- print(botName, ": Exiting Game.....")
- time.sleep(2)
- userChat();
- def randomNumber(rangeNum, modeCount):
- randomNum = []
- randomNum.clear()
- for num in range(50):
- random1 = random.randint(1, modeCount)
- if randomNum.count(random1) > 0:
- randomNum.remove(random1)
- elif len(randomNum) == rangeNum:
- break
- else:
- randomNum.append(random1)
- return randomNum
- def game(gameModes, counts, price, prevWin, countMode):
- global priceAll
- lotto = []
- print("-------------------------------------Welcome to "+gameModes+" Lotto--------------------------------------", "\nLotto price money: " + str(price))
- for num in range(1000):
- count = len(lotto)
- if count < 1:
- number = int(input("Enter a number("+str(counts + 1)+"): \n"))
- else:
- number = int(input("Enter next number("+str(counts + 1 - count)+"): \n"))
- if lotto.count(number) > 0:
- print("ERROR! Cannot enter the same value")
- elif number > countMode:
- print("ERROR! Cannot enter number higher than "+str(countMode))
- elif number <= 0:
- print("ERROR! Cannot enter number less than 1")
- elif count >= counts:
- lotto.append(number)
- print("------------------------------------------------------------------------------------------------\n" + "Here are your entered number: " + str(lotto), "\nWinning balls are shuffling...")
- time.sleep(2)
- print("Here are winning numbers!!", str(prevWin), "\n------------------------------------------------------------------------------------------------", "\nYour numbers: " + str(lotto), "\nWinning numbers: " + str(prevWin))
- time.sleep(2)
- if str(prevWin) == str(lotto):
- print("YOU WIN!")
- if counts == 2:
- priceAll = 10000
- elif counts == 5:
- priceAll = 1000
- print("Curent price: " + str(priceAll))
- time.sleep(2)
- else:
- priceAll = price + 500
- print("------------------------------------------------------------------------------------------------\n" + "AW SNAP! TRY AGAIN NEXT TIME!!", "\nCurent price: " + str(priceAll))
- time.sleep(2)
- ask = input("------------------------------------------------------------------------------------------------\n" + "Try Again? (Y/N)\n")
- if ask == "Y" or ask == "y":
- return price
- elif ask == "N" or ask == "n":
- print(botName, ": Exiting Game.....")
- time.sleep(2)
- userChat()
- elif number <= countMode:
- lotto.append(number)
- elif "AYOKO NA" in number:
- print(botName, ": Exiting Game.....")
- time.sleep(2)
- userChat()
- print(lotto)
- def MainLotto():
- print("--------------------------------------Welcome to IT-Lotto!--------------------------------------")
- a = 1
- price642, price645, price649, price3 = 1000, 1000, 1000, 10000
- while True:
- print("------------------------------------------------------------------------------------------------"+"\nYesterday's Winning numbers:")
- if a == True:
- 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)
- else:
- 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)
- today = date.today()
- prevWin1, prevWin2, prevWin3, prevWin4 = randomNumber(6, 42), randomNumber(6,45), randomNumber(6,49), randomNumber(3, 9)
- 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"))
- if mode == 1:
- game("6/42", 5, price642, prevWin1,42)
- price642 = priceAll
- elif mode == 2:
- game("6/45", 5, price645, prevWin2,45)
- price645 = priceAll
- elif mode == 3:
- game("6/49", 5, price649, prevWin3,49)
- price649 = priceAll
- elif mode == 4:
- game("Lky3", 2, price3, prevWin4,9)
- price3 = priceAll
- a = False
- def botIntro():
- print(botName,": Hello Nibba!")
- time.sleep(2)
- print(botName, "is typing......")
- time.sleep(2)
- print(botName, ": What can i do for you?")
- userChat()
- def botLibrary(chat):
- print(botName, "is typing......")
- time.sleep(1)
- if "MY NAME" in chat:
- print(botName, ": Your name is", yourName)
- elif "MY AGE" in chat:
- print(botName, ": You are", yourAge)
- elif "MY BIRTH" in chat:
- print(botName, ":", yourBirthDate, "is your bithday")
- elif "MY ADDRESS" in chat:
- print(botName, ": you live ", yourAdress)
- elif "YOUR BIRTH" in chat:
- print(botName, ":" , botBirthDate)
- elif "YOUR AGE" in chat or "OLD ARE YOU" in chat:
- print(botName,": I was born", botBirthDate)
- elif "YOUR ADDRESS" in chat:
- print(botName,": I live in", botAdress)
- elif "SEARCH" in chat:
- print(botName, ": What do you want to search master?")
- search = input(yourNickName +": ")
- webbrowser.open_new_tab("https://www.google.com/search?btrG=1&q=%s" % search)
- print(botName, ": Showing results for ", search)
- elif "PLAY GAME" in chat:
- print(botName, ": What Game you want to play?")
- print(botName, "is typing......")
- time.sleep(1)
- print(botName, ": You can play Rock Paper Scissor or Lotto")
- game = input(yourNickName + ": ").upper()
- if "LOTTO" in game:
- print(botName, ": Opening Lotto Game.....")
- time.sleep(2)
- MainLotto()
- elif "ROCK PAPER SCISSOR" in game or "RPS" in game:
- print(botName, ": Opening Rock Paper Scissor.....")
- time.sleep(2)
- RPS()
- elif "TRASH" in chat or "RECYCLE" in chat or "BASURA" in chat:
- print(botName, ": Cleaning Recycle Bin.....")
- time.sleep(1)
- os.system('cmd /c "rd /s c:\$Recycle.Bin"')
- print(botName, ": Done!")
- elif "WEBSITE" in chat:
- print(botName, ": What website you want to open master?")
- search = input(yourNickName + ": ")
- webbrowser.open_new_tab(search)
- print(botName, ": Showing results for ", search)
- else:
- print(botName, ": Sorry master, it's not on my database yet")
- def userChat():
- while True:
- userChat = input(yourNickName + ": ").upper()
- botLibrary(userChat)
- botIntro()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement