Skip to content
Permalink
385bc0d818
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
207 lines (182 sloc) 11 KB
#BEGINNING OF LUKES CODE
#rpy = input("Hello user, what's your name?")
from Check import checky, checkn
import urllib.parse
import urllib.request
import json
#import requests
#GROUP D4
#print(thisdict)
def VideoGames():
# print(books)
#this is the introductory section of the program which will ask the user about the
#video games that they play.
vid_choice = input("Whats your favourite video game?")
s = vid_choice
print(s.lower())
books = input("Sounds fun, I don't play too many video games. I'm more of a book person.\nDo you read any books?")
books.lower()
#asks user about the books which they read, and then about the genre which they prefer
if checky(books) == True:
genre = input("Nice! Any specific genre?")
genre.lower()
if "romance" in genre:
spookyA = input("Ah, that's quite different to me. I'm more into spooky stories")
print("Yeah, I love a good scary story. Sometimes though if I watch "
"them at night my mind plays tricks on me")
spookyA.lower()
elif "horror" in genre:
book_scary = input("I love scary books too! Any specific book that you like?")
print("I've never read " + book_scary + ". Maybe I'll check it out!")
elif "comedy" in genre:
print("I do love a funny book too, but I think my favourite genre is scary books")
elif "mystery" in genre:
genre_q = input(
"ooh, I do like a good mystery too! My favourite genre is horror though. You must be good at Cludo then?")
if checky(genre_q) == True:
print("Ah I'm awful at that kind of thing.")
elif checkn(genre_q) == True:
print("Oh you must just play it because it's fun!")
else:
print("I'm not familiar with that, please enter a valid input")
#this is the validation on the function for the genre of book.
elif checkn(books) == True:
#if the user does not read, then this section will execute, it will reccommend books to the user and so forth.
bookschoice = input("oh that's a shame, I read loads of books. You should give them a try")
print(
"Some good books which I can recommend include:\n1. Misery\n2. Ready Player One\n3. Game of Thrones\n4. Hunger Games")
c_b = input("So do you play any card/ board games?")
#asks the user if they play any card or board games and then makes a comment on this asking which one
if "y" in c_b:
# if checky(books)==True:
g_c = int(input("Ooooh! Me too, what do you play?\n1. Card Games\n2. Board Games"))
if g_c == 1:
#uses a map api to get location of the user and where they play their card or board games.
# usr_name = input("Ah Hello, what did you say your name was?")
endpoint = 'https://maps.googleapis.com/maps/api/directions/json?'
api_key = 'AIzaSyB39abG_ey_p_KzMCSzqjYsNjSG1NPK_r4'
# Asks the user to input Where they are and where they want to go.
origin = input('Where abouts do you live then? ').replace(' ', '+')
destination = input('and where do you play? ').replace(' ', '+')
# Building the URL for the request
nav_request = 'origin={}&destination={}&key={}'.format(origin, destination, api_key)
request = endpoint + nav_request
# Sends the request and reads the response.
response = urllib.request.urlopen(request).read()
# Loads response as JSON
directions = json.loads(response)
print(directions)
#it then outputs this previous information
cg_c = input("I do too! I play Magic: The Gathering. What do you play?")
if "magic" in cg_c:
#if the user plays magic: the gathering, then this next section will execute
magic_c = input("Hey me too! Magic is the best, I play commander, what about you?")
#asks them about the format which they play
if "ommander" in magic_c:
print("Yeah I play that too, its my favourite type!")
commandertype = int(input("What commander is it?"))
if(commandertype == "estrid" or commandertype == "Estrid"):
print("Ah! I use her too, great for keeping the game going and running down the enemy.")
else:
print("Ah, I use Estrid")
elif "standard" in magic_c:
#this section executes if they play magic using the standard format
print("Ah, like to keep it simple eh? I don't blame you")
colours = int(input("What deck colours? I'm running black and white\n1. Black\n2. White"
"\n3. Blue\n4. Red\n5. Green"))
# Black White Blue Red Green
#this next section asks them what colour decks they play (you pick two colours)
if "lack" in colours:
colour2 = int(input("Ah, black and what?"))
# 1.White\n2. Blue\n3. Red\n4. Green
if "hite" in colour2:
print("Ah, the same as me then! That's very interesting!")
elif "lue" in colour2:
print("A bit of technology and logic never hurt anyone!")
elif "ed" in colour2:
print("Oh, your one of the freedom players, very nic")
elif "reen" in colour2:
print("Ah, a druid type of guy, let nature take its path. Very nice")
else:
print("I don't recognise that...")
elif "hite" in colours:
colour2 = (input("Ah, white and what?"))
if "lack" in colour2:
print("Ah, the same as me then! That's very interesting!")
elif "lue" in colour2:
print("A bit of technology and logic never hurt anyone!")
elif "ed" in colour2:
print("Oh, your one of the freedom players, very nice")
elif "reen" in colour2:
print("Ah, a druid type of guy, let nature take its path. Very nice")
else:
print("I don't recognise that...")
elif "lue" in colours:
colour2 = int(input("Ah, blue and what?"))
# "1.White\n2. Black\n3. Red\n4. Green"))
if "hite" in colour2:
print("Ah, the same as me then! That's very interesting!")
elif "lack" in colour2:
print("So you want power above all else, nah I'm kidding, black is cool!")
elif "ed" in colour2:
print("Oh, your one of the freedom players, very nice")
elif "reen" in colour2:
print("Ah, a druid type of guy, let nature take its path. Very nice")
else:
print("I don't recognise that...")
elif "ed" in colours:
colour2 = int(input("Ah, Red and What?"))
# "1.White\n2. Blue\n3. Black\n4. Green"))
if "hite" in colour2:
print("Ah, the same as me then! That's very interesting!")
elif "lue" in colour2:
print("A bit of technology and logic never hurt anyone!")
elif "lack" in colour2:
print("So you want power above all else, nah I'm kidding, black is cool!")
elif "reen" in colour2:
print("Ah, a druid type of guy, let nature take its path. Very nice")
else:
print("I don't recognise that...")
elif "reen" in colours:
colour2 = int(input("Ah, green and what?"))
# colour2 = int(input("1.White\n2. Blue\n3. Red\n4. Black"))
if "hite" in colour2:
print("Ah, the same as me then! That's very interesting!")
elif "lue" in colour2:
print("A bit of technology and logic never hurt anyone!")
elif "ed" in colour2:
print("Oh, your one of the freedom players, very nice")
elif "lack" in colour2:
print("So you want power above all else, nah I'm kidding, black is cool!")
elif (colour2 != 4):
print("I don't recognise that")
elif "planeswalker" in magic_c:
good = input("I've never played that actually, is it good?")
#this executes if the user plays the planeswalker format
if "y" in good:
print("Fair enough, I'll have to check it out")
elif "n" in good:
print("Lol, that's hilarious")
elif "magic" not in cg_c:
print("Ah, fair enough well you do you!")
#if the user does not play magic the gathering
elif (g_c == 2):
#if the user answers using board games and not card games.
print("Ah yeah, some people class D&D as a board game, idk. One of my favourites is monopoly.")
favboard = input("Whats your favourite board game?")
reason = input("Ah yeah, I've played a bit of " + favboard + ". Why'd you like it so much?")
if (reason == ""):
print("Oh, I don't think you said anything there buddy")
else:
print("Ah I understand")
#if the user does not play card or board games this is the section which is executed.
elif checkn(books) == True:
print("Fair enough")
#####Start Code Here####################################
#this section calls the main video game function.
#choice = ""
#while choice != 50:
# choice = int(input("What do you want to talk about?\n1. Weather\n2. Games\n3. Phones\n"))
# if choice == 2:
# VideoGames()
#END OF LUKES CODE