Exemple #1
0
def showMap(Gamesize, Gamemode):
    Size = int(Gamesize)
    game.startGame(Gamesize, Gamemode==mode.BOT)
    buttons = [[None for x in range(Size)] for y in range(Size)]
    
    # in case the window was used before, clean it up
    clearWindow(MainWindow)
    
    # add Gamesize*Gamesize buttons in 2 dimensions to MainWindow
    for r in range(Size):
        for c in range(Size):
          state = str(game.getValue(r, c))
          newButton = tk.Button(MainWindow, text=state, borderwidth=1)
          newButton.config(height=int(Buttonsize/2), width=Buttonsize);
          newButton.grid(row=r, column=c)
          buttons[r][c] = newButton
          buttons[r][c]["command"] = partial(Move, r, c, buttons, 1, Gamemode) # 1: it's a move of the player on this end
          
    # add Menu button to MainWindow
    def localShowMenu():
        if tkMsg.askyesno("Spiel beenden?", "Möchten Sie das Spiel beenden und in das Menü zurückkehren?"):
            showMenu()
            
    btn_Menu = tk.Button(MainWindow, text='Menü')
    btn_Menu["command"] = localShowMenu
    btn_Menu.config(width=Size*Buttonsize)
    btn_Menu.grid(row=Size, column=0, columnspan=Size)
    MainWindow.update()
    
    if (Gamemode == mode.CLIENT):
        waitForMove(buttons, Gamemode) # Server has the first move
Exemple #2
0
def new_game():

    global username1
    global password1

    confirm_password = ""

    def create_password():
        global username1
        global password1
        global confirm_password

        password1 = str(input("PASSWORD - "))
        confirm_password = str(input("CONFIRM PASSWORD - "))

        if confirm_password != password1:
            time.sleep(1)
            print("\n%sERR : PASSWORDS DO NOT MATCH%s" % (fg(1), attr(0)))
            time.sleep(2)
            create_password()

    print("+==+ NEW USER REGISTRATION +==+\n")
    username1 = str(input("USERNAME - "))
    create_password()

    print("\n+==+ REGISTRATION COMPLETE +==+")
    time.sleep(1)
    print("\n%sWARNING : Creating a new HackSci game is permanent, you cannot restart.%s" % (
        fg(3), attr(0)))
    time.sleep(1)
    start_game = str(
        input("\nREADY : TYPE %sENTER %sTO CONFIRM - " % (fg(1), attr(0))))

    if start_game.upper() != "ENTER":
        time.sleep(1)
        print("\n%sERR : GAME FAILED TO INITIALIZE%s" % (fg(1), attr(0)))
        time.sleep(2)
        for x in range(0, 6):
            time.sleep(0.5)
            print("\nRESTORING FROM PREVIOUS SESSION SAVE%s" %
                  add_char(x, "."))
            if not x+1 == 6:
                clear_line(2)
            else:
                time.sleep(1)
                print("RESTORED.")
                time.sleep(2)
                for x in range(0, 4):
                    time.sleep(0.5)
                    print("\nINITIALIZING%s" % add_char(x, "."))
                    if not x+1 == 4:
                        clear_line(2)
                    else:
                        time.sleep(1)
                        print("\nDONE.\n")
                        time.sleep(2)
                        return new_game()
    else:
        time.sleep(2)
        startGame(username1, password1)
Exemple #3
0
def Learning(times, learningAgent="ReflexStateAgent", start = [], start_file = ''):
        if not hasattr(AIagents, learningAgent) or not hasattr(getattr(AIagents, learningAgent), 'getAction'):
            printAgentError(learningAgent)
            learningAgent = "ReflexStateAgent"
        agentClass = getattr(AIagents, learningAgent)
        agentClasstwo = getattr(AIagents, "ReflexLinearAgent")
        
        agents = [agentClass(i, evalFunc) for i in range(2)]

        if not start_file:
            print "not"
            setgrid([[{} for x in range(21)] for y in range(2)])
        else:
            import cPickle
            f = open(start_file)
            try:
                setgrid(cPickle.load(f))
            except:
                print "load base file fail, fall back to empty base lib"
                pass
            finally:
                f.close()

        for i in range(times):
            trainingDatas = []
            for agent in agents:
                agent.setValue(gridBoardLib)
            game = gameRunner.Game(agents, True)
            game.startGame()
            recordList = copy.deepcopy(game.recordList)

            printResult(recordList[-1], str(i))
            squareLost = game.leftSquares[0] - game.leftSquares[1]
            if recordList[-1][1] == -1:
                utilityList = [TIE_UTILITY, TIE_UTILITY]
            elif recordList[-1][1] == 0:
                squareLost = game.leftSquares[1] - game.leftSquares[0]
                #utilityList = [WIN_UTILITY + squareLost % 50, LOSE_UTILITY - squareLost % 50]
                utilityList = [WIN_UTILITY, LOSE_UTILITY]
            else:
                #utilityList = [LOSE_UTILITY - squareLost % 50, WIN_UTILITY + squareLost % 50]
                utilityList = [LOSE_UTILITY, WIN_UTILITY]
            recordList.pop()
            for i in range(len(recordList)):
                record = recordList[i]
            	trainingDatas.append((record[-1], record[0], squareLost, utilityList))
            training(trainingDatas)
            import cPickle
            f = open("g:\\shuju.txt","w")
            cPickle.dump(gridBoardLib, f)
            print "update"
            f.close()
         
        for i in range(3,21):   
            print gridBoardLib[0][i].values()
            print gridBoardLib[1][i].values()
def runGames(agents, numGames, record, switch, learn, learn_index, learn_pattern, data_file):
    games = []

    if learn:
        if learn_index == 0:
            Learning = loopLearn.Learning
        elif learn_index == 1:
            Learning = StateLearn.Learning
        elif learn_index == 2:
            Learning = lambda x: qLearn.Learning(x, learn_pattern = learn_pattern, start_file=data_file)
        else:
            print "index %d did not refer to any learning algorithm"%learn_index
            return
        Learning(numGames)
        return
    agentList = []
    for i in range(len(agents)):
        agent = agents[i]
        if not hasattr(AIagents, agent) or not hasattr(getattr(AIagents, agent), 'getAction'):
            game.printAgentError(agent)
            agent = "defaultAgent"
        agentList.append(getattr(AIagents, agent)(i))

    for i in range(numGames):
        game = gameRunner.Game(agentList, True)
        game.startGame()
        result = game.recordList[-1]
        printResult(result, str(i))
        if record:
            import time, cPickle
            filename = "%dtimes-"%numGames + "%s-vs-%s"%tuple([x.__class__.__name__ for x in agentList]) + time.strftime('%m-%d-%H-%M-%S',time.localtime(time.time())) + ".rep"
            f = file(filename, 'w')
            cPickle.dump(game.recordList, f)
            f.close()

    if switch:
        agentList = [agentList[1].__class__(0), agentList[0].__class__(1)]
        for i in range(numGames):
            game = gameRunner.Game(agentList, True)
            game.startGame()
            result = game.recordList[-1]
            if result[1] == -1:
                resultStr = "Tie!"
            else:
                resultStr = "agent%d Win!"%(1 - result[1])
                print "No.%d: agent1 First: %s\n\tLeftSquares: %d -- %d"%(i, resultStr, result[-1][1], result[-1][0])

            if record:
                import time, cPickle
                filename = "%dtimes-"%numGames + "%s-vs-%s"%tuple([x.__class__.__name__ for x in agentList]) + time.strftime('%m-%d-%H-%M-%S',time.localtime(time.time())) + ".rep"
                f = file(filename, 'w')
                cPickle.dump(game.recordList, f)
                f.close()
Exemple #5
0
def readMail(imapper, mailId=None, fakeMail=None):

    if DEBUG:
        mail_id = mailId
        mail = fakeMail
    else:
        mail_id = imapper.listids()[0]
        mail = imapper.mail(mail_id)

    # If new email
    if not db.isMailRead(mail_id):
        db.addReadMail(mail_id)

        if mail.title.upper() == "NEW":
            #make new game
            gameId = game.newGame(mail.body)
            firstPlayer = game.startGame(gameId)

            print("First player = " + str(firstPlayer))

            #Send first mail
            sendMail(
                db.getPlayer(gameId, firstPlayer)[2], gameId,
                db.getGame(gameId)[7] + playerInfoLog(gameId, firstPlayer) +
                instructions())

            return gameId
        #look for game with id in title
        elif not len(db.getGame(mail.title[4:])) == 0:

            gameId = mail.title[4:]
            playerEmail = mail.from_addr[mail.from_addr.find('<') +
                                         1:mail.from_addr.rfind('>')].lower()
            playerTuple = db.getPlayerByEmail(gameId, playerEmail)
            gameTuple = db.getGame(gameId)

            successfulRaise = True

            #if current player
            if playerTuple[1] == gameTuple[2]:  # current player

                if mail.body.upper().startswith("CALL"):
                    player.call(gameId, playerTuple)
                elif mail.body.upper().startswith("RAISE"):
                    if len(mail.body.split(" ")) < 2:
                        successfulRaise = False
                    else:
                        if mail.body.split(" ")[1].strip().find('\r') == -1:
                            chipsToRaiseTo = int(
                                mail.body.split(" ")[1].strip())
                        else:
                            chipsToRaiseTo = int(
                                mail.body.split(" ")[1].strip()
                                [:mail.body.split(" ")[1].strip().find('\r')])
                        successfulRaise = player.raiseTo(
                            gameId, playerTuple, chipsToRaiseTo)

                elif mail.body.upper().startswith("FOLD"):
                    player.fold(gameId, playerTuple)
                elif mail.body.upper().startswith("ALL IN"):
                    successfulRaise = player.allIn(gameId, playerTuple)
                else:
                    successfulRaise = False

                if successfulRaise:

                    if not game.allAreAllIn(gameId):
                        nextPlayerTuple = game.nextPlayer(gameId)

                    if game.checkForRoundCompletion(gameId):
                        # Starts next round and returns active player
                        nextPlayerTuple = db.getPlayer(gameId,
                                                       game.nextRound(gameId))

                    if game.isHandOver(gameId):
                        game.showdown(gameId)

                        # Send mail to all players
                        for i in range(db.numberOfPlayersInGame(gameId)):
                            sendMail(
                                db.getPlayer(gameId, i)[2], gameId,
                                db.getGame(gameId)[7])

                        if not game.isGameOver(gameId):
                            nextPlayerTuple = db.getPlayer(
                                gameId, game.startHand(gameId))

                    if not game.isGameOver(gameId):
                        if not game.allAreAllIn(gameId):
                            db.updateGame(
                                gameId,
                                "currentPlayer = " + str(nextPlayerTuple[1]))
                            sendMail(
                                nextPlayerTuple[2], gameId,
                                db.getGame(gameId)[7] +
                                playerInfoLog(gameId, nextPlayerTuple[1]) +
                                instructions())
                        else:
                            _, _, currentPlayer, dealer, _, pot, betToMatch, handLog, _, _, _ = db.getGame(
                                gameId)
                            numberOfPlayers = db.numberOfPlayersInGame(gameId)

                            while not game.isHandOver(gameId):
                                game.nextRound(gameId)

                            game.showdown(gameId)

                            # Send mail to all players
                            for i in range(db.numberOfPlayersInGame(gameId)):
                                sendMail(
                                    db.getPlayer(gameId, i)[2], gameId,
                                    db.getGame(gameId)[7])

                            if not game.isGameOver(gameId):
                                nextPlayerTuple = db.getPlayer(
                                    gameId, game.startHand(gameId))
                                sendMail(
                                    nextPlayerTuple[2], gameId,
                                    db.getGame(gameId)[7] +
                                    playerInfoLog(gameId, nextPlayerTuple[1]) +
                                    instructions())

                    if game.isGameOver(gameId):
                        _, _, currentPlayer, dealer, _, pot, betToMatch, handLog, _, _, _ = db.getGame(
                            gameId)
                        numberOfPlayers = db.numberOfPlayersInGame(gameId)

                        for i in range(numberOfPlayers):
                            _, _, _, _, _, _, isAllIn, folded, eliminated, _, isChecked, _ = db.getPlayer(
                                gameId, i)
                            if not bool(eliminated):
                                winner = i
                                break

                        for i in range(numberOfPlayers):
                            sendMail(
                                db.getPlayer(gameId,
                                             i)[2], gameId, "The winner was " +
                                db.getPlayer(gameId, winner)[3] +
                                "! Thanks for playing :)")

                        db.deleteGame(gameId)

                # unsuccessful raise
                else:
                    sendMail(
                        playerEmail, gameId,
                        "Invalid input. Please try again.\r\n" +
                        instructions())
Exemple #6
0
		settings = menu.initMenu()
		load = False
	else:
		f = open(saveFile, "r")
		loadTuple = pickle.load(f)
		settings = loadTuple[0]
		loadGrid = loadTuple[1]
		loadHints = loadTuple[2]
		load = True
		
	# Show Game
	#================================================
	restart = False
	code = []
	if load == True:
		loadData = (loadGrid, loadHints)
	else:
		loadData = ()
	while True: # Keep the program running until the user presses "Quit Game"
		settings["saveFile"] = saveFile
		play = game.startGame(settings, restart, code, load, loadData) # Code parameter is for restarted games
		load = False
		toMenu = play[2]
		if toMenu:
			break
		elif play[0] == True:
			restart = True
			code = play[1]
		else:
			restart = False
			code = []
 def startButton_click(self):
     startGame(self.fileAddress.encode('utf8'), self.VHNUMS)
Exemple #8
0
from setup import *
from game import startGame

file = open('world.txt')

line = file.readline()
while line:
    if line.strip().startswith("#"):
        continue

    if line.strip() == "LOCATION":
        title = getTitle(file)
        short = getShortDescription(file)
        long = getLongDescription(file)
        world[title] = {
            "short description": short,
            "long description": long,
            "visited": False
        }

    if line.strip() == "LAYOUT":
        world['layout'] = getWorldLayout(file)

    if line.strip() == "ACTIONS":
        actionsList = getActionsForLocation(file)
        world[title]['actions'] = actionsList

    line = file.readline()

startGame(world, player)
	keyboardOldState = keyboardState;
	keyboardState = pygame.key.get_pressed();

def isKeyDown(key):
	return keyboardState[key];
def isKeyPressed(key):
	return keyboardState[key] and (not keyboardOldState[key]);
def isKeyReleased(key):
	return (not keyboardState[key]) and keyboardOldState[key];


windowSurface = pygame.display.set_mode( (screenW, screenH) );
font = pygame.font.Font('freesansbold.ttf', 20);

game.startGame();

gameRunning = True;
while gameRunning == True:

	updateEvents();

	game.updateGame();
	game.drawGame();
	pygame.display.update();

	clock.tick(60);	

pygame.quit();
sys.exit();
Exemple #10
0

root = tk.Tk()
root.title("2048 game")
root.resizable(False, False)
high_score = 0
board = game_GUI()
board.pack()  #this puts the canvas into the window
# values = [0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 0, 4, 2, 2]
# while(True):
#     inp = input("What? \n")
#     if (inp == "y"):
#         board.print_new_grid(values)
#     random.shuffle(values)

grid = game.startGame()
board.print_new_grid(grid)
try:
    while (game.endGame(grid) == False):
        high_score = max(grid)
        inp = input("Move? \n")
        if inp == "a":
            if (game.moveLeft(grid)):
                game.makeMove(grid)
            else:
                print("Make a valid move!!")
                print("")

        elif inp == "d":
            if (game.moveRight(grid)):
                game.makeMove(grid)
Exemple #11
0
 def playGame(self, screen, clock):
     for i in range(self.num_of_player):
         game.startGame(self.player[i], screen, clock)
Exemple #12
0
    arg2 = None
    save_info('start')

    if command == 'change_dir':
        os.chdir(sys.argv[2])
        input = input("введите следующую команду: ").split(' ')
        command = input[0]
        arg1 = input[1]
        arg2 = input[2]

    if command == 'list':
        get_list()
    elif command == 'create_file':
        create_file(arg1 or sys.argv[2], arg2 or sys.argv[3])
    elif command == 'create_folder':
        create_folder(arg1 or sys.argv[2])
    elif command == 'delete':
        delete_file(arg1 or sys.argv[2])
    elif command == 'copy':
        copy_file(arg1 or sys.argv[2], arg2 or sys.argv[3])
    elif command == 'game':
        game.startGame()
    elif command == 'help':
        print(
            "create_file name - создать файл\ncreate_folder name - создать папку\ndelete name - удалить файл/папку\nlist True\False - список файлов/папок\ncopy name newName - копировать файл/папку\ngame - играть\nchange_dir path - сменить текущую папку выполнения скрипта"
        )
except Exception as e:
    print("Что-то пошло не так: {}".format(e))

save_info('end')
Exemple #13
0
def main():
    import tkinter as tk

    query = takeCommand()

    while(query != None):


        if ('answer of'  in query.lower() or  'calculate' in query.lower() or  '/' in query.lower()  or  'x' in query.lower()  or  '-' in query.lower()  or  '+' in query.lower()  or  'tan' in query.lower()  or  'sine' in query.lower()  or  'cosine' in query.lower() or  'power' in query.lower()):
            speak("Working on it...")
            string = query
            #calculate 10 + 10 
            string = re.findall('\d+', string)

            if (len(string) < 2):
                
                operand1 = int(string[0])
                # print(operand1)
                
                if 'sine'  in query.lower():
                    answer = sin(operand1)
                    speak("Answer is :"+str(answer))
                    InsertText("Answer is : "+ str(answer))
                elif 'cosine' in query.lower():
                    answer = cos(operand1)
                    speak("Answer is :"+str(answer))
                    InsertText("Answer is : "+ str(answer))
                elif 'tan'  in query.lower():
                    answer = tan(operand1)
                    speak("Answer is :"+str(answer))
                    InsertText("Answer is : "+ str(answer))
            else:
                operand1 = int(string[0])
                operand2 = int(string[1])
   
            # print("string: "+str(string))
            # print("operand1:"+str(operand1))
            # print("operand2:"+str(operand2))

                if ('+') in query.lower():
                    answer = Sum(operand1,operand2)
                    speak("Answer is :"+str(answer))
                    InsertText("Answer is : "+ str(answer))
            
                elif ('x') in query.lower():
                    answer = multiply(operand1,operand2)
                    speak("Answer is :"+str(answer))
                    output.delete('1.0',END)
                    InsertText("Answer is : "+ str(answer))


                elif ('/') in query.lower():
                    answer = divide(operand1,operand2)
                    speak("Answer is :"+str(answer))
                    InsertText("Answer is : "+ str(answer))


                elif ('-') in query.lower():
                    answer = subtract(operand1,operand2)
                    if int(answer) <0:
                        speak("Answer is negtive:"+str(answer))
                    else:
                        speak("Answer is : "+str(answer))                    
        
                    InsertText("Answer is : "+ str(answer))


                elif ('power') in query.lower():
                    answer = power(operand1,operand2)
                    speak("Answer is :"+str(answer))
                    InsertText("Answer is : "+ str(answer))

                else:
                    speak("This is so hard for me, Im sorry")
                    InsertText("This is so hard for me, Im sorry")


            break

        if ('wikipedia') in query.lower():
            speak('searching on wikipedia...')
            query = query.replace("wikipedia","")
            results = wikipedia.summary(query, sentences=2)
            # print(results)
            if results == False:
                speak("I didnt find any information")
                InsertText("I didnt find any information")
            else:
                print(results)
                InsertText(results)
                speak(results)
                
            break

        if ('search on google for' in query.lower()  or 'google for' in query.lower() or 'search for' in query.lower()):
            text = query
            text = text.replace('google','')
            text = text.replace('search on' or 'search for' or 'search about','')
            speak("Searching on google..")
            # InsertText("Searching on google..")
            
            links = googleSearch(text)
            speak('I found this links may it could help you...')
            # print(links)
            InsertText(links)                
            break

        if (('translate' in query.lower()) or ('french' in query.lower())  or ('spanish' in query.lower())  or ('german' in query.lower())  or ('italian' in query.lower())  ):
            if ('french') in query.lower():
                ret = toFrench(query)
                print(ret)
                speakforeigner(ret)
                InsertText(ret)
                voice = engine.getProperty('voices')[1] 
                engine.setProperty('voice', voice.id)

            elif ('german') in query.lower():
                ret = toGerman(query)
                print(ret)
                speakforeigner(ret)
                InsertText(ret)
                voice = engine.getProperty('voices')[1]
                engine.setProperty('voice', voice.id)
            
            elif ('spanish') in query.lower():
                ret = toSpanish(query)
                print(ret)
                speakforeigner(ret)
                InsertText(ret)
                voice = engine.getProperty('voices')[1]
                engine.setProperty('voice', voice.id)

            elif ('italian') in query.lower():
                ret = toItalian(query)
                print(ret)
                speakforeigner(ret)
                InsertText(ret)
                voice = engine.getProperty('voices')[1]
                engine.setProperty('voice', voice.id)

            elif ('portuguese') in query.lower():
                ret = toPortuguese(query)
                print(ret)
                speakforeigner(ret)
                InsertText(ret)
                voice = engine.getProperty('voices')[1]
                engine.setProperty('voice', voice.id)
                
            else:
                speakforeigner("Im sorry I dont understand this language")
                InsertText("Im sorry I dont understand this language")

            break

        if ('open youtube') in query.lower():
            url = "youtube.com"
            chrome_path="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
            speak("hold on")
            webbrowser.get(chrome_path).open(url)
            break
 
        if ('open google'  in query.lower()   or 'google' in query.lower()) :
            url = "google.com"
            speak("Im wondering what are you looking for")
            chrome_path="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
            webbrowser.get(chrome_path).open(url)
            break

        if 'open facebook' in query.lower():
            url = "facebook.com"
            chrome_path="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
            speak("Im on it")
            webbrowser.get(chrome_path).open(url)
            break

        if 'open linkedin' in query.lower():
            url = "linkedin.com"
            chrome_path="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
            speak("lets get professional")
            webbrowser.get(chrome_path).open(url)
            break

        if 'open stackover flow' in query.lower():
            url = "stackoverflow.com"
            chrome_path="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
            speak("hold on")
            webbrowser.get(chrome_path).open(url)
            break

        if 'open soundcloud' in query.lower():
            url = "soundcloud.com"
            chrome_path="C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
            speak("Im on it")
            webbrowser.get(chrome_path).open(url)
            break

        if ('play music' or 'play my list' or 'open my playlist' or 'open my favorite songs')in query.lower():
            songs_dir = 'E:\\desktop\\FUN\\Myplaylist' 
            songs = os.listdir(songs_dir)
            speak("playlist shuffle..")
            InsertText('playlist shuffle..')
            
            print(songs)
            os.startfile(os.path.join(songs_dir, songs[0]))
            break

        if ('the time now' in query.lower() or 'time' in query.lower() or 'what time is it' in query.lower() or 'how much oclock' in query.lower()):
            time = timevalue
            speak("The time is")
            speak(time)
            InsertText(time)
            

            break

        if ('what is the date' in query.lower() or 'What date is it' in query.lower() or 'What day is it' in query.lower() or "today's date" in query.lower()):
            date = datevalue
            speak("Today is ")
            speak(date)
            InsertText(date)
            break

        if ('what is the temperature now' or 'What is the weather today' or 'is it hot today' or "is it cold today") in query.lower():
            temp = tempvalue
            speak("Today's temperture is ")
            speak(temp)
            InsertText(temp)
            break

        if ('open my code' or 'open code' or 'your code') in query.lower():
            code_dir = 'C:\\Users\\Abdullah\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe' 
            os.startfile(os.path.join(code_dir))
            break

        if ('f*** you' or 'm**********r' or 'you are disgusting'  or 'ugly' or 'bitch' or 'you are stupid' or "you're stupid") in query.lower():
            speak('You are so rude, I will not respond to that')
            InsertText('You are so rude, I will not respond to that')
            break

        if ('love you' in query.lower() or 'would you marry me' in query.lower()):
            speak('oh, you are so sweet')
            InsertText('oh, you are so sweet')
            break

        if 'email to tina' in query.lower():
            try:
                speak("what should I send")
                content = takeCommand()
                to ='*****@*****.**'
                sendEmail(to,content)
                speak("Email has been sent successfully")
                break
            except Exception as e:
                print(e)
                speak("There is a problem in email security, please check it and try again")
                break

        if ('draw' in query.lower() or 'drew' in query.lower()):
            speak("Lets draw, to save you drawing just press control  S")
            InsertText('press " CTRL+S" to save your draw..')
            drawStart()
            
            break

        if ('game' in query.lower()):
            speak("lets play a game")
            InsertText("Have fun..")
            startGame()

            
            break
    
        else:
            speak("Im not sure I understand")
            speak("Say it again")
            InsertText("Im not sure I understand\nSay it again")
            query= takeCommand()