├── README.md ├── README.md.txt └── main.py /README.md: -------------------------------------------------------------------------------- 1 | # Game_Hub1 2 | GameHub is an exciting and impressive game project that offers a diverse collection of games, exceptional development standards, and the potential for ongoing involvement and improvement. 3 | -------------------------------------------------------------------------------- /README.md.txt: -------------------------------------------------------------------------------- 1 | GameHub is a Python evaluation project that showcases a collection of classic games, including Rock Paper Scissors, Tic Tac Toe, Snake, and Flappy Bird. The project runs on the output window, providing a simple and accessible platform for users to enjoy a variety of games. -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import time 2 | import pyttsx3 3 | import datetime 4 | import random 5 | from pygame import mixer 6 | from tkinter import * 7 | et=datetime.datetime.now() 8 | mixer.init() 9 | mixer.music.set_volume(0.15) 10 | mixer.music.load('D:/mu.mp3') 11 | mixer.music.play() 12 | engine = pyttsx3.init() 13 | s22=0 14 | def loading(): 15 | print("\r■□□□□□□□□□ 10% Loading your game",end="") 16 | time.sleep(0.2) 17 | print("\r■■□□□□□□□□ 20% Loading your game.",end="") 18 | time.sleep(0.2) 19 | print("\r■■■□□□□□□□ 30% Loading your game..",end="") 20 | time.sleep(0.2) 21 | print("\r■■■■□□□□□□ 40% Loading your game...",end="") 22 | time.sleep(0.2) 23 | print("\r■■■■■□□□□□ 50% Loading your game",end="") 24 | time.sleep(0.2) 25 | print("\r■■■■■■□□□□ 60% Loading your game.",end="") 26 | time.sleep(0.2) 27 | print("\r■■■■■■■□□□ 70% Loading your game..",end="") 28 | time.sleep(0.2) 29 | print("\r■■■■■■■■□□ 80% Loading your game...",end="") 30 | time.sleep(0.2) 31 | print("\r■■■■■■■■■□ 90% Loading your game",end="") 32 | time.sleep(0.4) 33 | print("\r■■■■■■■■■■ 100% Loading your game.",end="") 34 | time.sleep(0.4) 35 | print("\r ") 36 | def guessingnumber(): 37 | print("\n" * 4) 38 | print(""" 39 | \033[31m░██████╗░██╗░░░██╗███████╗░██████╗░██████╗██╗███╗░░██╗░██████╗░\033[0m \033[32m███╗░░██╗██╗░░░██╗███╗░░░███╗██████╗░███████╗██████╗░░██████╗\033[0m 40 | \033[31m██╔════╝░██║░░░██║██╔════╝██╔════╝██╔════╝██║████╗░██║██╔════╝░a\033[0m \033[32m████╗░██║██║░░░██║████╗░████║██╔══██╗██╔════╝██╔══██╗██╔════╝\033[0m 41 | \033[31m██║░░██╗░██║░░░██║█████╗░░╚█████╗░╚█████╗░██║██╔██╗██║██║░░██╗░\033[0m \033[32m██╔██╗██║██║░░░██║██╔████╔██║██████╦╝█████╗░░██████╔╝╚█████╗░\033[0m 42 | \033[31m██║░░╚██╗██║░░░██║██╔══╝░░░╚═══██╗░╚═══██╗██║██║╚████║██║░░╚██╗\033[0m \033[32m██║╚████║██║░░░██║██║╚██╔╝██║██╔══██╗██╔══╝░░██╔══██╗░╚═══██╗\033[0m 43 | \033[31m╚██████╔╝╚██████╔╝███████╗██████╔╝██████╔╝██║██║░╚███║╚██████╔╝\033[0m \033[32m██║░╚███║╚██████╔╝██║░╚═╝░██║██████╦╝███████╗██║░░██║██████╔╝\033[0m 44 | \033[31m░╚═════╝░░╚═════╝░╚══════╝╚═════╝░╚═════╝░╚═╝╚═╝░░╚══╝░╚═════╝░\033[0m \033[32m╚═╝░░╚══╝░╚═════╝░╚═╝░░░░░╚═╝╚═════╝░╚══════╝╚═╝░░╚═╝╚═════╝░\033[0m""") 45 | print(""" 46 | \033[45m\033[30m ▀█▀ █▀█   █▀█ █░░ ▄▀█ █▄█   █▀█ █▀█ █▀▀ █▀ █▀     █▀█ \033[49m\033[0m 47 | \033[45m\033[30m ░█░ █▄█   █▀▀ █▄▄ █▀█ ░█░   █▀▀ █▀▄ ██▄ ▄█ ▄█     █▀▀ \033[49m\033[0m 48 | 49 | \033[43m\033[30m ▀█▀ █▀█   █▀█ █░█ █ ▀█▀    █▀█ █▀█ █▀▀ █▀ █▀     █▀█ \033[49m\033[0m 50 | \033[43m\033[30m ░█░ █▄█   ▀▀█ █▄█ █ ░█░    █▀▀ █▀▄ ██▄ ▄█ ▄█     ▀▀█ \033[49m\033[0m""") 51 | print("\n" * 6) 52 | engine = pyttsx3.init() 53 | def tts2(s): 54 | print(s) 55 | rate = engine.getProperty('rate') 56 | engine.setProperty('rate', 170) 57 | volume = engine.getProperty('volume') 58 | engine.setProperty('volume', 5.0) 59 | engine.say(s) 60 | engine.runAndWait() 61 | s = random.randint(1, 20) 62 | tries = 5 63 | tts2("This is a guessing game") 64 | while True: 65 | tts("Do you want to play aur quit") 66 | us3=input("Do you want to play or quit : ") 67 | if us3=="p" or us3=="P": 68 | tts2("I have chosen a number between 1 and 20 which you have to guess") 69 | tts2("Please choose a difficulty level") 70 | tts2("type e for easy , n for normal and h for hard ") 71 | difficulty = input() 72 | if (difficulty == 'e'): 73 | tts2(f"You have 5 tries to guess the number") 74 | tts2("Please type a number between 1 and 20 : ") 75 | num = int(input()) 76 | while (tries > 0): 77 | if (num >= 0 and num <= 20): 78 | if (num == s): 79 | tts2("Congratulations! You guessed the number") 80 | tries = 0 81 | elif (num > s): 82 | tts2(f"Sorry! {num} is wrong. My number is less than that.") 83 | tries = tries - 1 84 | if (tries > 0): 85 | if (tries == 1): 86 | tts2(f"Be careful! This is your final chance!") 87 | tts2("Enter a guess :- ") 88 | num = int(input()) 89 | else: 90 | tts2(f"You have {tries} tries left") 91 | tts2("Enter a guess :- ") 92 | num = int(input()) 93 | else: 94 | tts2(f"Sorry! you lost. The number was {s}") 95 | elif (num < s): 96 | tts2(f"Sorry! {num} is wrong. My number is more than that.") 97 | tries = tries - 1 98 | if (tries > 0): 99 | if (tries == 1): 100 | tts2(f"Be careful! This is your final chance!") 101 | tts2("Enter a guess :- ") 102 | num = int(input()) 103 | else: 104 | tts2(f"You have {tries} tries left") 105 | tts2("Enter a guess :- ") 106 | num = int(input()) 107 | else: 108 | tts2(f"You lost. The number was {s}") 109 | else: 110 | tts2("Please type a number between 1 and 20 only!") 111 | tts2("Enter a guess :- ") 112 | num = int(input()) 113 | elif (difficulty == 'n'): 114 | tries = 4 115 | tts2(f"You have 4 tries to guess the number") 116 | tts2("Please type a number between 1 and 20 : ") 117 | num = int(input()) 118 | while (tries > 0): 119 | if (num >= 0 and num <= 20): 120 | if (num == s): 121 | tts2("Congratulations! You guessed the number") 122 | tries = 0 123 | elif (num > s): 124 | tts2(f"Sorry! {num} is wrong. My number is less than that.") 125 | tries = tries - 1 126 | if (tries > 0): 127 | if (tries == 1): 128 | tts2(f"Be careful! This is your final chance!") 129 | tts2("Enter a guess :- ") 130 | num = int(input()) 131 | else: 132 | tts2(f"You have {tries} tries left") 133 | tts2("Enter a guess :- ") 134 | num = int(input()) 135 | else: 136 | tts2(f"Sorry! you lost. The number was {s}") 137 | elif (num < s): 138 | tts2(f"Sorry! {num} is wrong. My number is more than that.") 139 | tries = tries - 1 140 | if (tries > 0): 141 | if (tries == 1): 142 | tts2(f"Be careful! This is your final chance!") 143 | tts2("Enter a guess :- ") 144 | num = int(input()) 145 | else: 146 | tts2(f"You have {tries} tries left") 147 | tts2("Enter a guess :- ") 148 | num = int(input()) 149 | else: 150 | tts2(f"You lost. The number was {s}") 151 | else: 152 | tts2("Please type a number between 1 and 20 only!") 153 | tts2("Enter a guess :- ") 154 | num = int(input()) 155 | elif (difficulty == 'h'): 156 | tries = 3 157 | tts2(f"You have 3 tries to guess the number") 158 | tts2("Please type a number between 1 and 20 : ") 159 | num = int(input()) 160 | while (tries > 0): 161 | if (num >= 0 and num <= 20): 162 | if (num == s): 163 | tts2("Congratulations! You guessed the number") 164 | tries = 0 165 | elif (num > s): 166 | tts2(f"Sorry! {num} is wrong. My number is less than that.") 167 | tries = tries - 1 168 | if (tries > 0): 169 | if (tries == 1): 170 | tts2(f"Be careful! This is your final chance!") 171 | tts2("Enter a guess :- ") 172 | num = int(input()) 173 | else: 174 | tts2(f"You have {tries} tries left") 175 | tts2("Enter a guess :- ") 176 | num = int(input()) 177 | else: 178 | tts2(f"Sorry! you lost. The number was {s}") 179 | elif (num < s): 180 | tts2(f"Sorry! {num} is wrong. My number is more than that.") 181 | tries = tries - 1 182 | if (tries > 0): 183 | if (tries == 1): 184 | tts2(f"Be careful! This is your final chance!") 185 | tts2("Enter a guess :- ") 186 | num = int(input()) 187 | else: 188 | tts2(f"You have {tries} tries left") 189 | tts2("Enter a guess :- ") 190 | num = int(input()) 191 | else: 192 | tts2(f"You lost. The number was {s}") 193 | else: 194 | tts2("Please type a number between 1 and 20 only!") 195 | tts2("Enter a guess :- ") 196 | num = int(input()) 197 | elif us3 == "Q" or us3 == "q": 198 | break 199 | else: 200 | tts("please give input from the menu only") 201 | print("Please give input from the main menu only") 202 | print("Quiting in 3", end="") 203 | time.sleep(1) 204 | print("\b2", end="") 205 | time.sleep(1) 206 | print("\b1", end="") 207 | time.sleep(1) 208 | print("\rGame Over ") 209 | tts(" game over - taking you back to main menu") 210 | def tts(s): 211 | rate = engine.getProperty('rate') 212 | engine.setProperty('rate', 170) 213 | volume = engine.getProperty('volume') 214 | engine.setProperty('volume', 5.0) 215 | engine.say(s) 216 | engine.runAndWait() 217 | def ttf(s): 218 | rate = engine.getProperty('rate') 219 | engine.setProperty('rate', 250) 220 | volume = engine.getProperty('volume') 221 | engine.setProperty('volume', 5.0) 222 | engine.say(s) 223 | engine.runAndWait() 224 | def tictactoe(): 225 | engine = pyttsx3.init() 226 | print("\n" * 4) 227 | print(""" 228 | \033[32m████████╗██╗░█████╗░\033[0m\033[34m  ████████╗░█████╗░░█████╗░\033[0m\033[31m  ████████╗░█████╗░███████╗\033[0m 229 | \033[32m╚══██╔══╝██║██╔══██╗\033[0m\033[34m  ╚══██╔══╝██╔══██╗██╔══██╗\033[0m\033[31m  ╚══██╔══╝██╔══██╗██╔════╝\033[0m 230 | \033[32m░░░██║░░░██║██║░░╚═╝\033[0m\033[34m  ░░░██║░░░███████║██║░░╚═╝\033[0m\033[31m  ░░░██║░░░██║░░██║█████╗░░\033[0m 231 | \033[32m░░░██║░░░██║██║░░██╗\033[0m\033[34m  ░░░██║░░░██╔══██║██║░░██╗\033[0m\033[31m  ░░░██║░░░██║░░██║██╔══╝░░\033[0m 232 | \033[32m░░░██║░░░██║╚█████╔╝\033[0m\033[34m  ░░░██║░░░██║░░██║╚█████╔╝\033[0m\033[31m  ░░░██║░░░╚█████╔╝███████╗\033[0m 233 | \033[32m░░░╚═╝░░░╚═╝░╚════╝░\033[0m\033[34m  ░░░╚═╝░░░╚═╝░░╚═╝░╚════╝░\033[0m\033[31m  ░░░╚═╝░░░░╚════╝░╚══════╝\033[0m""") 234 | print(""" 235 | \033[45m\033[30m ▀█▀ █▀█   █▀█ █░░ ▄▀█ █▄█   █▀█ █▀█ █▀▀ █▀ █▀     █▀█ \033[49m\033[0m 236 | \033[45m\033[30m ░█░ █▄█   █▀▀ █▄▄ █▀█ ░█░   █▀▀ █▀▄ ██▄ ▄█ ▄█     █▀▀ \033[49m\033[0m 237 | 238 | \033[43m\033[30m ▀█▀ █▀█   █▀█ █░█ █ ▀█▀    █▀█ █▀█ █▀▀ █▀ █▀     █▀█ \033[49m\033[0m 239 | \033[43m\033[30m ░█░ █▄█   ▀▀█ █▄█ █ ░█░    █▀▀ █▀▄ ██▄ ▄█ ▄█     ▀▀█ \033[49m\033[0m""") 240 | print("\n" * 6) 241 | tts("welcome to tic tac toe - its a two player game so don't forget to bring your friend with you") 242 | 243 | while True: 244 | tts("to play press p -- to quit press q- so enter your choice" + str(name)) 245 | count = 1 246 | start = input("Enter your Choice : ") 247 | print() 248 | if start == "p" or start=="P": 249 | li = [1, 2, 3, 4, 5, 6, 7, 8, 9] 250 | li2=[] 251 | print("\033[1m\u0332" + str(li[0]) + "|\u0332" + str(li[1]) + "|\u0332" + str(li[2]) + "\n\u0332" + str( 252 | li[3]) + "|\u0332" + str(li[4]) + "|\u0332" + str(li[5]) + "\n" + str(li[6]) + "|" + str( 253 | li[7]) + "|" + str( 254 | li[8]) + "\033[0m\n") 255 | Player_one = name 256 | tts( name+ "What is your friend's name") 257 | Player_two = input("Player2 name : ") 258 | print() 259 | while count <= 9: 260 | if count % 2 != 0: 261 | print(Player_one + " Your Turn") 262 | tts(Player_one + "your turn") 263 | tts("Enter Position number") 264 | i = int(input("Enter Position no: ")) 265 | if i not in li2 and i in li: 266 | li2.append(i) 267 | li[i - 1] = "X" 268 | else: 269 | count-=1 270 | print("Enter a valid move") 271 | tts(Player_one + "Plz enter a valid move") 272 | else: 273 | print(Player_two + " Your Turn") 274 | tts(Player_two + "your turn") 275 | tts("Enter Position number") 276 | i = int(input("Enter Position no: ")) 277 | if i not in li2 and i in li: 278 | li2.append(i) 279 | li[i - 1] = "O" 280 | else: 281 | count-=1 282 | print("Enter a valid move") 283 | tts(Player_two + "Plz enter a valid move") 284 | count = count + 1 285 | print("\033[1m\u0332" + str(li[0]) + "|\u0332" + str(li[1]) + "|\u0332" + str(li[2]) + "\n\u0332" + str( 286 | li[3]) + "|\u0332" + str(li[4]) + "|\u0332" + str(li[5]) + "\n" + str(li[6]) + "|" + str( 287 | li[7]) + "|" + str(li[8]) + "\033[0m\n") 288 | if li[0] == "X" and li[1] == "X" and li[2] == "X": 289 | li[0] = "-" 290 | li[1] = "-" 291 | li[2] = "-" 292 | print(Player_one + " Win") 293 | tts(Player_one + " Win") 294 | break 295 | elif li[0] == "O" and li[1] == "O" and li[2] == "O": 296 | li[0] = "-" 297 | li[1] = "-" 298 | li[2] = "-" 299 | print(Player_two + " Win") 300 | tts(Player_two+" Win") 301 | break 302 | elif li[3] == "X" and li[4] == "X" and li[5] == "X": 303 | li[3] = "-" 304 | li[4] = "-" 305 | li[5] = "-" 306 | print(Player_one + " Win") 307 | tts(Player_one+"Win") 308 | break 309 | elif li[3] == "O" and li[4] == "O" and li[5] == "O": 310 | li[3] = "-" 311 | li[4] = "-" 312 | li[5] = "-" 313 | print(Player_two + " Win") 314 | tts(Player_two+"Win") 315 | break 316 | elif li[6] == "X" and li[7] == "X" and li[8] == "X": 317 | li[6] = "-" 318 | li[7] = "-" 319 | li[8] = "-" 320 | print(Player_one + " Win") 321 | tts(Player_one+"Win") 322 | break 323 | elif li[6] == "O" and li[7] == "O" and li[8] == "O": 324 | li[6] = "-" 325 | li[7] = "-" 326 | li[8] = "-" 327 | print(Player_two + " Win") 328 | tts(Player_two+"Win") 329 | break 330 | if li[0] == "X" and li[3] == "X" and li[6] == "X": 331 | li[0] = "|" 332 | li[3] = "|" 333 | li[6] = "|" 334 | print(Player_one + " Win") 335 | tts(Player_one+"Win") 336 | break 337 | elif li[0] == "O" and li[3] == "O" and li[6] == "O": 338 | li[0] = "|" 339 | li[3] = "|" 340 | li[6] = "|" 341 | print(Player_two + " Win") 342 | tts(Player_two + "Win") 343 | break 344 | elif li[1] == "X" and li[4] == "X" and li[7] == "X": 345 | li[1] = "|" 346 | li[4] = "|" 347 | li[7] = "|" 348 | print(Player_one + " Win") 349 | tts(Player_one + " Win") 350 | break 351 | elif li[1] == "O" and li[4] == "O" and li[7] == "O": 352 | li[1] = "|" 353 | li[4] = "|" 354 | li[7] = "|" 355 | print(Player_two + " Win") 356 | tts(Player_two + "Win") 357 | break 358 | elif li[2] == "X" and li[5] == "X" and li[8] == "X": 359 | li[2] = "|" 360 | li[5] = "|" 361 | li[8] = "|" 362 | print(Player_one + " Win") 363 | tts(Player_one + " Win") 364 | break 365 | elif li[2] == "O" and li[5] == "O" and li[8] == "O": 366 | li[2] = "|" 367 | li[5] = "|" 368 | li[8] = "|" 369 | print(Player_two + " Win") 370 | tts(Player_two + "Win") 371 | break 372 | 373 | elif li[0] == "X" and li[4] == "X" and li[8] == "X": 374 | li[0] = "\\" 375 | li[4] = "\\" 376 | li[8] = "\\" 377 | print(Player_one + " Win") 378 | tts(Player_one + " Win") 379 | break 380 | elif li[0] == "O" and li[4] == "O" and li[8] == "O": 381 | li[0] = "\\" 382 | li[4] = "\\" 383 | li[8] = "\\" 384 | print(Player_two + " Win") 385 | tts(Player_two + "Win") 386 | break 387 | elif li[2] == "X" and li[4] == "X" and li[6] == "X": 388 | li[2] = "/" 389 | li[4] = "/" 390 | li[6] = "/" 391 | print(Player_one + " Win") 392 | tts(Player_one + " Win") 393 | break 394 | elif li[2] == "O" and li[4] == "O" and li[6] == "O": 395 | li[2] = "/" 396 | li[4] = "/" 397 | li[6] = "/" 398 | print(Player_two + " Win") 399 | tts(Player_two+"Win") 400 | break 401 | print("\033[1m\u0332" + str(li[0]) + "|\u0332" + str(li[1]) + "|\u0332" + str(li[2]) + "\n\u0332" + str( 402 | li[3]) + "|\u0332" + str(li[4]) + "|\u0332" + str(li[5]) + "\n" + str(li[6]) + "|" + str( 403 | li[7]) + "|" + str( 404 | li[8]) + "\033[0m\n") 405 | elif start == "Q" or start == "q": 406 | break 407 | else: 408 | tts("please give input from the menu only") 409 | print("Please give input from the main menu only") 410 | print("Quiting in 3", end="") 411 | time.sleep(1) 412 | print("\b2", end="") 413 | time.sleep(1) 414 | print("\b1", end="") 415 | time.sleep(1) 416 | print("\rGame Over ") 417 | tts(" game over - taking you back to main menu") 418 | def rps(): 419 | def emoj(n): 420 | if n == 1: 421 | return "🪨" 422 | elif n == 2: 423 | return "📃" 424 | elif n == 3: 425 | return "✂️" 426 | 427 | print("\n" * 4) 428 | print(""" 429 | \033[32m██████╗░\033[0m   \033[34m██████╗░\033[0m   \033[31m░██████╗\033[0m 430 | \033[32m██╔══██╗\033[0m   \033[34m██╔══██╗\033[0m   \033[31m██╔════╝\033[0m 431 | \033[32m██████╔╝\033[0m   \033[34m██████╔╝\033[0m   \033[31m╚█████╗░\033[0m 432 | \033[32m██╔══██╗\033[0m   \033[34m██╔═══╝░\033[0m   \033[31m░╚═══██╗\033[0m 433 | \033[32m██║░░██║\033[0m   \033[34m██║░░░░░\033[0m   \033[31m██████╔╝\033[0m 434 | \033[32m╚═╝░░╚═╝\033[0m   \033[34m╚═╝░░░░░\033[0m   \033[31m╚═════╝░\033[0m""") 435 | print(""" 436 | \033[45m\033[30m █▀▀ █▀█ █▀█   █▀█ █▀█ █▀   █▀█ █▀█ █▀▀ █▀ █▀        ▄█ ░░▄▀ ▀█ ░░▄▀ ▀█ \033[49m\033[0m 437 | \033[45m\033[30m █▀░ █▄█ █▀▄   █▀▄ █▀▀ ▄█   █▀▀ █▀▄ ██▄ ▄█ ▄█        ░█ ▄▀░░ █▄ ▄▀░░ ▄█ \033[49m\033[0m 438 | 439 | \033[43m\033[30m ▀█▀ █▀█   █▀█ █░░ ▄▀█ █▄█ ░░▄▀ █▀█ █░█ █ ▀█▀  █▀█ ░░▄▀ █▀█ \033[49m\033[0m 440 | \033[43m\033[30m ░█░ █▄█   █▀▀ █▄▄ █▀█ ░█░ ▄▀░░ ▀▀█ █▄█ █ ░█░  █▀▀ ▄▀░░ ▀▀█ \033[49m\033[0m""") 441 | print("\n" * 6) 442 | tts("welcome to Rock Paper scissors - to input rock press 1- for paper press 2 and for scissors press 3 - to play press p and to quit the game press q") 443 | Flag = True 444 | while Flag == True: 445 | tts("do you want to play or quit - please enter your choice") 446 | start = input("Do you want to play/quit : ") 447 | if start == "p": 448 | print("there will three be three rounds of rock paper scissors between us,so get ready",end="") 449 | tts("there will be three rounds of rock paper scissors between us- so get ready") 450 | print("\r ") 451 | u = 3 452 | sp = 0 453 | sc = 0 454 | while u > 0: 455 | print() 456 | print("ROCK", end="") 457 | ttf("ROCK") 458 | print("\rPAPER", end="") 459 | ttf("PAPER") 460 | print("\rSCISSORS", end="") 461 | ttf("SCISSORS") 462 | print("\rSHOOT ", end="") 463 | ttf("SHOOT") 464 | print("\r ") 465 | tts("Choose any one of the rock paper and scissors") 466 | a = int(input("Enter Your choice : ")) 467 | if a>=1 and a<=3: 468 | p = emoj(a) 469 | c = emoj(random.randint(1, 3)) 470 | print(p + " " + c, end="") 471 | time.sleep(2) 472 | print() 473 | if p == c: 474 | print("Its a Draw") 475 | tts("its a draw") 476 | u += 1 477 | elif p == "🪨" and c == "✂️" or p == "✂️" and c == "📃" or p == "📃" and c == "🪨": 478 | print("You Win this one 🥺") 479 | tts("You win this one") 480 | sp += 1 481 | else: 482 | print("Haha! I Win this one 😏") 483 | tts("Haha! I win this one") 484 | sc+=1 485 | 486 | else: 487 | tts("please enter a valid move") 488 | u+=1 489 | u -= 1 490 | tts("the score is given below") 491 | print("\nScore is : " + str(sp) + " - " + str(sc), end="") 492 | time.sleep(3) 493 | if sp > sc: 494 | print("\r\033[1mYou are the winner 🥺 \033[0m") 495 | tts("You are the winner") 496 | elif sc > sp: 497 | print("\r\033[1mI am the winner 😎🏆\033[0m") 498 | tts("I am the winner") 499 | else: 500 | print("\r\033[1mIts a Draw \033[0m") 501 | elif start == "Q" or start == "q": 502 | Flag = False 503 | else: 504 | tts("please give input from the menu only") 505 | print("Please give input from the main menu only") 506 | print() 507 | print("Quiting in 3", end="") 508 | time.sleep(1) 509 | print("\b2", end="") 510 | time.sleep(1) 511 | print("\b1", end="") 512 | time.sleep(1) 513 | print("\rGame Over ") 514 | tts(" game over - taking you back to main menu") 515 | def minesweeper(): 516 | print("\n" * 4) 517 | print(""" 518 | \033[32m███╗░░░███╗██╗███╗░░██╗███████╗░██████╗░██╗░░░░░░░██╗███████╗███████╗██████╗░███████╗██████╗░\033[0m 519 | \033[32m████╗░████║██║████╗░██║██╔════╝██╔════╝░██║░░██╗░░██║██╔════╝██╔════╝██╔══██╗██╔════╝██╔══██╗\033[0m 520 | \033[32m██╔████╔██║██║██╔██╗██║█████╗░░╚█████╗░░╚██╗████╗██╔╝█████╗░░█████╗░░██████╔╝█████╗░░██████╔╝\033[0m 521 | \033[32m██║╚██╔╝██║██║██║╚████║██╔══╝░░░╚═══██╗░░████╔═████║░██╔══╝░░██╔══╝░░██╔═══╝░██╔══╝░░██╔══██╗\033[0m 522 | \033[32m██║░╚═╝░██║██║██║░╚███║███████╗██████╔╝░░╚██╔╝░╚██╔╝░███████╗███████╗██║░░░░░███████╗██║░░██║\033[0m 523 | \033[32m╚═╝░░░░░╚═╝╚═╝╚═╝░░╚══╝╚══════╝╚═════╝░░░░╚═╝░░░╚═╝░░╚══════╝╚══════╝╚═╝░░░░░╚══════╝╚═╝░░╚═╝\033[0m""") 524 | print(""" 525 | \033[45m\033[30m ▀█▀ █▀█   █▀█ █░░ ▄▀█ █▄█   █▀█ █▀█ █▀▀ █▀ █▀     █▀█ \033[49m\033[0m 526 | \033[45m\033[30m ░█░ █▄█   █▀▀ █▄▄ █▀█ ░█░   █▀▀ █▀▄ ██▄ ▄█ ▄█     █▀▀ \033[49m\033[0m 527 | 528 | \033[43m\033[30m ▀█▀ █▀█   █▀█ █░█ █ ▀█▀    █▀█ █▀█ █▀▀ █▀ █▀     █▀█ \033[49m\033[0m 529 | \033[43m\033[30m ░█░ █▄█   ▀▀█ █▄█ █ ░█░    █▀▀ █▀▄ ██▄ ▄█ ▄█     ▀▀█ \033[49m\033[0m""") 530 | print("\n" * 6) 531 | tts("welcome to minesweeper- to play press p - to quit press q") 532 | 533 | while True: 534 | tts("Do you want to play or quit") 535 | us=input("Do you want to play/quit : ").strip() 536 | if us=="P" or us=="p": 537 | tts("i have hidden bombs according to the difficulty levels- so Enter your choice") 538 | user_input = input("Easy Average or Difficult (e/m/d) : ").strip() 539 | if user_input == "E" or user_input == "e": 540 | g = [(" 1", " 2", " 3", " 4", " 5"), 541 | [("1 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 542 | "\033[42m \033[0m"], 543 | [("2 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 544 | "\033[42m \033[0m"], 545 | [("3 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 546 | "\033[42m \033[0m"], 547 | [("4 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 548 | "\033[42m \033[0m"], 549 | [("5 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 550 | "\033[42m \033[0m"]] 551 | g2 = [(" 1", " 2", " 3", " 4", " 5"), 552 | [("1 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 553 | "\033[42m \033[0m"], 554 | [("2 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 555 | "\033[42m \033[0m"], 556 | [("3 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 557 | "\033[42m \033[0m"], 558 | [("4 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 559 | "\033[42m \033[0m"], 560 | [("5 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 561 | "\033[42m \033[0m"]] 562 | count = 0 563 | while count < 3: 564 | i1 = random.randint(1, 5) 565 | i2 = random.randint(1, 5) 566 | if g[i1][i2] == "\033[41m💣\033[0m": 567 | continue 568 | else: 569 | g[i1][i2] = "\033[41m💣\033[0m" 570 | count += 1 571 | count = 0 572 | score = 0 573 | for i in g2: 574 | for j in i: 575 | print(j, end="") 576 | print() 577 | while True: 578 | print("Enter the row and column separated with space : ") 579 | tts("Enter the row and column separated with space : ") 580 | s = input().split() 581 | print() 582 | nrows = int(s[0]) 583 | mcols = int(s[1]) 584 | if nrows>=1 and nrows<=5 and mcols>=1 and mcols<=5: 585 | if g[nrows][mcols] == "\033[41m💣\033[0m": 586 | g2[nrows][mcols] = "\033[41m💣\033[0m" 587 | mixer.init() 588 | mixer.music.load('D:/blast.mp3') 589 | mixer.music.play() 590 | for i in g2: 591 | for j in i: 592 | print(j, end="") 593 | print() 594 | print() 595 | time.sleep(2) 596 | break 597 | else: 598 | g2[nrows][mcols] = " " 599 | g[nrows][mcols] = " " 600 | mixer.init() 601 | mixer.music.load('D:/correct.mp3') 602 | mixer.music.play() 603 | score += 1 604 | for i in g2: 605 | for j in i: 606 | print(j, end="") 607 | print() 608 | print() 609 | else: 610 | print("Enter a valid move\n") 611 | tts("enter a valid move") 612 | 613 | for i in g: 614 | for j in i: 615 | print(j, end="") 616 | print() 617 | mixer.init() 618 | mixer.music.set_volume(0.15) 619 | mixer.music.load('D:/mu.mp3') 620 | mixer.music.play() 621 | print() 622 | print("Your Score is : " + str(score) + "/22") 623 | tts("Your Score is : " + str(score) + "out of 22") 624 | elif user_input == "m" or user_input == "M": 625 | g = [(" 1", " 2", " 3", " 4", " 5"), 626 | [("1 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 627 | "\033[42m \033[0m"], 628 | [("2 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 629 | "\033[42m \033[0m"], 630 | [("3 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 631 | "\033[42m \033[0m"], 632 | [("4 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 633 | "\033[42m \033[0m"], 634 | [("5 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 635 | "\033[42m \033[0m"]] 636 | g2 = [(" 1", " 2", " 3", " 4", " 5"), 637 | [("1 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 638 | "\033[42m \033[0m"], 639 | [("2 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 640 | "\033[42m \033[0m"], 641 | [("3 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 642 | "\033[42m \033[0m"], 643 | [("4 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 644 | "\033[42m \033[0m"], 645 | [("5 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 646 | "\033[42m \033[0m"]] 647 | count = 0 648 | while count < 4: 649 | i1 = random.randint(1, 5) 650 | i2 = random.randint(1, 5) 651 | if g[i1][i2] == "\033[41m💣\033[0m": 652 | continue 653 | else: 654 | g[i1][i2] = "\033[41m💣\033[0m" 655 | count += 1 656 | count = 0 657 | score = 0 658 | for i in g2: 659 | for j in i: 660 | print(j, end="") 661 | print() 662 | while True: 663 | print("Enter the row and column separated with space : ") 664 | tts("Enter the row and column separated with space : ") 665 | s = input().split() 666 | print() 667 | nrows = int(s[0]) 668 | mcols = int(s[1]) 669 | if nrows >= 1 and nrows <= 5 and mcols >= 1 and mcols <= 5: 670 | if g[nrows][mcols] == "\033[41m💣\033[0m": 671 | g2[nrows][mcols] = "\033[41m💣\033[0m" 672 | mixer.init() 673 | mixer.music.load('D:/.mp3') 674 | mixer.music.play() 675 | for i in g2: 676 | for j in i: 677 | print(j, end="") 678 | print() 679 | print() 680 | time.sleep(2) 681 | break 682 | else: 683 | g2[nrows][mcols] = " " 684 | g[nrows][mcols] = " " 685 | mixer.init() 686 | mixer.music.load('D:/correct.mp3') 687 | mixer.music.play() 688 | score += 1 689 | for i in g2: 690 | for j in i: 691 | print(j, end="") 692 | print() 693 | print() 694 | else: 695 | print("Enter a valid move\n") 696 | tts("enter a valid move") 697 | 698 | for i in g: 699 | for j in i: 700 | print(j, end="") 701 | print() 702 | mixer.init() 703 | mixer.music.set_volume(0.15) 704 | mixer.music.load('D:/mu.mp3') 705 | mixer.music.play() 706 | print() 707 | print("Your Score is : " + str(score) + "/21") 708 | tts("Your Score is : " + str(score) + "out of 21") 709 | elif user_input == "d" or user_input == "D": 710 | g = [(" 1", " 2", " 3", " 4", " 5"), 711 | [("1 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 712 | "\033[42m \033[0m"], 713 | [("2 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 714 | "\033[42m \033[0m"], 715 | [("3 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 716 | "\033[42m \033[0m"], 717 | [("4 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 718 | "\033[42m \033[0m"], 719 | [("5 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 720 | "\033[42m \033[0m"]] 721 | g2 = [(" 1", " 2", " 3", " 4", " 5"), 722 | [("1 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 723 | "\033[42m \033[0m"], 724 | [("2 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 725 | "\033[42m \033[0m"], 726 | [("3 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 727 | "\033[42m \033[0m"], 728 | [("4 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 729 | "\033[42m \033[0m"], 730 | [("5 "), "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", "\033[42m \033[0m", 731 | "\033[42m \033[0m"]] 732 | count = 0 733 | while count < 5: 734 | i1 = random.randint(1, 5) 735 | i2 = random.randint(1, 5) 736 | if g[i1][i2] == "\033[41m💣\033[0m": 737 | continue 738 | else: 739 | g[i1][i2] = "\033[41m💣\033[0m" 740 | count += 1 741 | count = 0 742 | score = 0 743 | for i in g2: 744 | for j in i: 745 | print(j, end="") 746 | print() 747 | while True: 748 | print("Enter the row and column separated with space : ") 749 | tts("Enter the row and column separated with space : ") 750 | s = input().split() 751 | print() 752 | nrows = int(s[0]) 753 | mcols = int(s[1]) 754 | if nrows >= 1 and nrows <= 5 and mcols >= 1 and mcols <= 5: 755 | if g[nrows][mcols] == "\033[41m💣\033[0m": 756 | g2[nrows][mcols] = "\033[41m💣\033[0m" 757 | mixer.init() 758 | mixer.music.load('D:/blast.mp3') 759 | mixer.music.play() 760 | for i in g2: 761 | for j in i: 762 | print(j, end="") 763 | print() 764 | print() 765 | time.sleep(2) 766 | break 767 | else: 768 | g2[nrows][mcols] = " " 769 | g[nrows][mcols] = " " 770 | mixer.init() 771 | mixer.music.load('D:/correct.mp3') 772 | mixer.music.play() 773 | score += 1 774 | for i in g2: 775 | for j in i: 776 | print(j, end="") 777 | print() 778 | print() 779 | else: 780 | print("Enter a valid move\n") 781 | tts("enter a valid move") 782 | for i in g: 783 | for j in i: 784 | print(j, end="") 785 | print() 786 | mixer.init() 787 | mixer.music.set_volume(0.15) 788 | mixer.music.load('D:/mu.mp3') 789 | mixer.music.play() 790 | print() 791 | print("Your Score is : " + str(score) + "/20") 792 | tts("Your Score is : " + str(score) + "out of 20") 793 | elif us=="q" or us=="Q": 794 | break 795 | else: 796 | print("Please enter input from the menu") 797 | tts("please enter input from the menu") 798 | print("Quiting in 3", end="") 799 | time.sleep(1) 800 | print("\b2", end="") 801 | time.sleep(1) 802 | print("\b1", end="") 803 | time.sleep(1) 804 | print("\rGame Over ") 805 | tts(" game over - taking you back to main menu") 806 | def fastestfinger(): 807 | print("\n" * 4) 808 | print(""" 809 | \033[32m███████╗░█████╗░░██████╗████████╗███████╗░██████╗████████╗\033[0m \033[34m ███████╗██╗███╗░░██╗░██████╗░███████╗██████╗░\033[0m 810 | \033[32m██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝\033[0m \033[34m ██╔════╝██║████╗░██║██╔════╝░██╔════╝██╔══██╗\033[0m 811 | \033[32m█████╗░░███████║╚█████╗░░░░██║░░░█████╗░░╚█████╗░░░░██║░░░\033[0m \033[34m █████╗░░██║██╔██╗██║██║░░██╗░█████╗░░██████╔╝\033[0m 812 | \033[32m██╔══╝░░██╔══██║░╚═══██╗░░░██║░░░██╔══╝░░░╚═══██╗░░░██║░░░\033[0m \033[34m ██╔══╝░░██║██║╚████║██║░░╚██╗█╔══╝░░░██╔══██╗\033[0m 813 | \033[32m██║░░░░░██║░░██║██████╔╝░░░██║░░░███████╗██████╔╝░░░██║░░░\033[0m \033[34m ██║░░░░░██║██║░╚███║╚██████╔╝███████╗██║░░██║\033[0m 814 | \033[32m╚═╝░░░░░╚═╝░░╚═╝╚═════╝░░░░╚═╝░░░╚══════╝╚═════╝░░░░╚═╝░░░\033[0m \033[34m ╚═╝░░░░░╚═╝╚═╝░░╚══╝░╚═════╝░╚══════╝╚═╝░░╚═╝\033[0m""") 815 | print(""" 816 | \033[45m\033[30m ▀█▀ █▀█   █▀█ █░░ ▄▀█ █▄█   █▀█ █▀█ █▀▀ █▀ █▀     █▀█ \033[49m\033[0m 817 | \033[45m\033[30m ░█░ █▄█   █▀▀ █▄▄ █▀█ ░█░   █▀▀ █▀▄ ██▄ ▄█ ▄█     █▀▀ \033[49m\033[0m 818 | 819 | \033[43m\033[30m ▀█▀ █▀█   █▀█ █░█ █ ▀█▀    █▀█ █▀█ █▀▀ █▀ █▀     █▀█ \033[49m\033[0m 820 | \033[43m\033[30m ░█░ █▄█   ▀▀█ █▄█ █ ░█░    █▀▀ █▀▄ ██▄ ▄█ ▄█     ▀▀█ \033[49m\033[0m""") 821 | print("\n"*5) 822 | tts(" this is the fastest finger - ") 823 | while True: 824 | tts("to play press p - to quit press q") 825 | tts("do you want to play or quit") 826 | us4=input("Do you want to play/quit : ") 827 | if us4=="P" or us4=="p": 828 | print("You have to press the stop button when your name appears on the screen to win.") 829 | tts("You have to press the stop button when your name appears on the screen to win.") 830 | li = ["rakshit", "priyam", "purav", "priyank", "rachit","ramesh","suresh"] 831 | li.append(name) 832 | 833 | # Create an instance of tkinter frame or window 834 | flag=True 835 | win = Tk() 836 | 837 | running = True 838 | 839 | # Define a function to print the text in a loop 840 | def print_text(): 841 | global x 842 | x = li[random.randint(0, len(li) - 1)] 843 | if running: 844 | print(f"\r {x}", end="") 845 | win.after(700, print_text) 846 | 847 | # Define a function to stop the loop 848 | def on_stop(): 849 | global running 850 | global x 851 | running = False 852 | if x == name: 853 | print("\n You won 🎊") 854 | tts("You won") 855 | win.destroy() 856 | else: 857 | print("\n👍🏻Better luck next time") 858 | tts("Better luck next time") 859 | win.destroy() 860 | 861 | # to customise the button 862 | stop = Button(win, text="""█▀ ▀█▀ █▀█ █▀█\n▄█ ░█░ █▄█ █▀▀""") 863 | stop.config(command=on_stop) 864 | stop.config(font=('', 20, 'bold')) 865 | stop.config(bg='#FFFF00') 866 | stop.config(fg='#000000') 867 | stop.config(activebackground='#ff0000') 868 | stop.config(activeforeground='#000000') 869 | stop.pack(padx=10, pady=10) 870 | 871 | # Run a function to print text in window 872 | win.after(1000, print_text) 873 | 874 | win.mainloop() 875 | time.sleep(3) 876 | elif us4=="q" or us4=="Q": 877 | break 878 | else: 879 | print("Please enter input from the menu") 880 | tts("please enter input from the menu") 881 | print("Quiting in 3", end="") 882 | time.sleep(1) 883 | print("\b2", end="") 884 | time.sleep(1) 885 | print("\b1", end="") 886 | time.sleep(1) 887 | print("\rGame Over ") 888 | tts(" game over - taking you back to main menu") 889 | def wel(): 890 | print(""" 891 | 892 | \033[34m░██████╗\033[0m\033[31m░░█████╗\033[0m\033[33m░███╗░░░███╗\033[0m\033[32m███████╗\033[0m\033[31m  ██╗░░██╗\033[0m\033[34m██╗░░░██╗\033[0m\033[32m██████╗░\033[0m 893 | \033[34m██╔════╝\033[0m\033[31m░██╔══██╗\033[0m\033[33m████╗░████║\033[0m\033[32m██╔════╝\033[0m\033[31m  ██║░░██║\033[0m\033[34m██║░░░██║\033[0m\033[32m██╔══██╗\033[0m 894 | \033[34m██║░░██╗\033[0m\033[31m░███████║\033[0m\033[33m██╔████╔██║\033[0m\033[32m█████╗░░\033[0m\033[31m  ███████║\033[0m\033[34m██║░░░██║\033[0m\033[32m██████╦╝\033[0m 895 | \033[34m██║░░╚██╗\033[0m\033[31m██╔══██║\033[0m\033[33m██║╚██╔╝██║\033[0m\033[32m██╔══╝░░\033[0m\033[31m  ██╔══██║\033[0m\033[34m██║░░░██║\033[0m\033[32m██╔══██╗\033[0m 896 | \033[34m╚██████╔╝\033[0m\033[31m██║░░██║\033[0m\033[33m██║░╚═╝░██║\033[0m\033[32m███████╗\033[0m\033[31m  ██║░░██║\033[0m\033[34m╚██████╔╝\033[0m\033[32m██████╦╝\033[0m 897 | \033[34m░╚═════╝░\033[0m\033[31m╚═╝░░╚═╝\033[0m\033[33m╚═╝░░░░░╚═╝\033[0m\033[32m╚══════╝\033[0m\033[31m  ╚═╝░░╚═╝\033[0m\033[34m░╚═════╝░\033[0m\033[32m╚═════╝░\033[0m""") 898 | print(""" BY CODE BLASTERS💣""") 899 | print(""" \033[42m\033[30m ▀█▀ █ █▀▀   ▀█▀ ▄▀█ █▀▀   ▀█▀ █▀█ █▀▀                                   ▀█▀ \033[49m\033[0m 900 | \033[42m\033[30m ░█░ █ █▄▄   ░█░ █▀█ █▄▄   ░█░ █▄█ ██▄                                   ░█░ \033[49m\033[0m 901 | 902 | \033[44m\033[30m █▀▀ █░█ █▀▀ █▀ █▀ █ █▄░█ █▀▀   █▄░█ █░█ █▀▄▀█ █▄▄ █▀▀ █▀█                █▀▀ \033[49m\033[0m 903 | \033[44m\033[30m █▄█ █▄█ ██▄ ▄█ ▄█ █ █░▀█ █▄█   █░▀█ █▄█ █░▀░█ █▄█ ██▄ █▀▄                █▄█ \033[49m\033[0m 904 | 905 | \033[41m\033[30m █▀▄▀█ █ █▄░█ █▀▀   █▀ █░█░█ █▀▀ █▀▀ █▀█ █▀▀ █▀█                          █▀▄▀█ \033[49m\033[0m 906 | \033[41m\033[30m █░▀░█ █ █░▀█ ██▄   ▄█ ▀▄▀▄▀ ██▄ ██▄ █▀▀ ██▄ █▀▄                          █░▀░█ \033[49m\033[0m 907 | 908 | \033[45m\033[30m █▀█ █▀█ █▀▀ █▄▀   █▀█ ▄▀█ █▀█ █▀▀ █▀█   █▀ █▀▀ █ █▀ █▀ █▀█ █▀█ █▀        █▀█ \033[49m\033[0m 909 | \033[45m\033[30m █▀▄ █▄█ █▄▄ █░█   █▀▀ █▀█ █▀▀ ██▄ █▀▄   ▄█ █▄▄ █ ▄█ ▄█ █▄█ █▀▄ ▄█        █▀▄ \033[49m\033[0m 910 | 911 | \033[43m\033[30m █▀▀ ▄▀█ █▀ ▀█▀ █▀▀ █▀ ▀█▀     █▀▀ █ █▄░█ █▀▀ █▀▀ █▀█                     █▀▀ \033[49m\033[0m 912 | \033[43m\033[30m █▀░ █▀█ ▄█ ░█░ ██▄ ▄█ ░█░     █▀░ █ █░▀█ █▄█ ██▄ █▀▄                     █▀░ \033[49m\033[0m 913 | 914 | \033[46m\033[30m █▀▄▀█ █░█ █▀ █ █▀▀   █▀█ █░░ ▄▀█ █▄█ ░░▄▀ █▀█ ▄▀█ █░█ █▀ █▀▀ █▀█ \033[49m\033[0m 915 | \033[46m\033[30m █░▀░█ █▄█ ▄█ █ █▄▄   █▀▀ █▄▄ █▀█ ░█░ ▄▀░░ █▀▀ █▀█ █▄█ ▄█ ██▄ █▀▀ \033[49m\033[0m""") 916 | while True: 917 | wel() 918 | tts("welcome to Game Hub - the world of gaming - Please enter your name") 919 | name=input("Enter your Name :") 920 | tts("nice name "+name) 921 | tts(" what would you like to play - for tic tac toe press -t , -for guessing numbers press -g , - for minesweeper press -m , for rock paper scissors press -r, for fastest finger press -f , to play or pause music press-p , to quit the main menu press - q") 922 | tts("So what's Your choice"+name) 923 | count=0 924 | countwin = 0 925 | while True: 926 | if countwin==1: 927 | wel() 928 | choice=input("Enter your Choice : ") 929 | if choice=="t" or choice=="T": 930 | loading() 931 | tictactoe() 932 | countwin=1 933 | elif choice=="g" or choice=="G": 934 | loading() 935 | guessingnumber() 936 | countwin=1 937 | elif choice=="m" or choice=="M": 938 | loading() 939 | minesweeper() 940 | countwin=1 941 | elif choice=="r" or choice=="R": 942 | loading() 943 | rps() 944 | countwin=1 945 | elif choice=="f" or choice=="F": 946 | loading() 947 | fastestfinger() 948 | countwin=1 949 | elif (choice=="p" or choice=="P") and count%2==0: 950 | mixer.music.pause() 951 | tts(" the music is now paused- plz enter your choice again") 952 | count+=1 953 | elif (choice=="p" or choice=="P") and count%2!=0: 954 | mixer.music.play() 955 | tts("Playing music - plz enter your choice") 956 | count+=1 957 | elif choice=="q": 958 | break 959 | else: 960 | tts("Enter a Choice from main menu only") 961 | else: 962 | choice = input("Enter your Choice : ") 963 | if choice == "t" or choice == "T": 964 | countwin = 1 965 | loading() 966 | tictactoe() 967 | elif choice == "g" or choice == "G": 968 | countwin = 1 969 | loading() 970 | guessingnumber() 971 | elif choice == "m" or choice == "M": 972 | loading() 973 | minesweeper() 974 | countwin=1 975 | elif choice == "r" or choice == "R": 976 | countwin = 1 977 | loading() 978 | rps() 979 | elif choice == "f" or choice == "F": 980 | loading() 981 | fastestfinger() 982 | countwin=1 983 | elif (choice == "p" or choice == "P") and count % 2 == 0: 984 | mixer.music.pause() 985 | tts(" the music is now paused- plz enter your choice again") 986 | count += 1 987 | elif (choice == "p" or choice == "P") and count % 2 != 0: 988 | mixer.music.play() 989 | tts("Playing music - plz enter your choice") 990 | count += 1 991 | elif choice == "q" or choice=="Q": 992 | break 993 | else: 994 | tts("Enter a Choice from main menu only") 995 | 996 | break 997 | st=datetime.datetime.now() 998 | tts("below is the given time period in which you have played game on our server") 999 | print() 1000 | print(f"Today you did gaming for {st-et} seconds") --------------------------------------------------------------------------------