Advertisement
here2share

# word_guess_wrestling.py

Feb 25th, 2020
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 11.31 KB | None | 0 0
  1. # word_guess_wrestling.py ZZZ
  2.  
  3. '''
  4. Each code number is a clue in representing what the mystery word is
  5. '''
  6.  
  7. from time import sleep as x
  8. from random import *
  9. import os
  10. clear=lambda: os.system('cls')
  11.  
  12. max_level = 5000
  13.  
  14. game_seed = randint(0,99999)
  15. test = int(''.join([str(ord(z)-32) for z in 'ThisIsJustForTesting'])) ###
  16. print "Please Wait A Few Second To Initialize..."
  17. seed(test)
  18.  
  19. all_words = '''
  20. 11 AGENCY
  21. 11 AMOUNT
  22. 11 AUTHOR
  23. 11 BEHIND
  24. 11 BELONG
  25. 11 BEYOND
  26. 11 BOUNCE
  27. 11 BRANCH
  28. 11 BREATH
  29. 11 BRIDGE
  30. 11 BRUTAL
  31. 11 BURDEN
  32. 11 CHANGE
  33. 11 CHARGE
  34. 11 CLERGY
  35. 11 COLUMN
  36. 11 COMBAT
  37. 11 COMEDY
  38. 11 COMPEL
  39. 11 COUNTY
  40. 11 COUPLE
  41. 11 CUSTOM
  42.  
  43. 11 DEPLOY
  44. 11 DOUBLE
  45. 11 FABRIC
  46. 11 FORBID
  47. 11 FORGET
  48. 11 FORMAL
  49. 11 FORMAT
  50. 11 GENIUS
  51. 11 GROUND
  52. 11 GUITAR
  53. 11 IMPACT
  54. 11 IMPORT
  55. 11 IMPOSE
  56. 11 INFORM
  57. 11 LAUNCH
  58. 11 LAYOUT
  59. 11 LEGACY
  60. 11 LENGTH
  61. 11 MARBLE
  62. 11 MARGIN
  63. 11 METHOD
  64. 11 MINUTE
  65. 11 MOBILE
  66. 11 MUSCLE
  67. 11 NEARBY
  68.  
  69. 11 PARISH
  70. 11 PEANUT
  71. 11 PERMIT
  72. 11 PHRASE
  73. 11 PLENTY
  74. 11 POETRY
  75. 11 POLICY
  76. 11 PROFIT
  77. 11 REPLAY
  78. 11 SAFETY
  79. 11 SAMPLE
  80. 11 SIMPLE
  81. 11 SLIGHT
  82. 11 SODIUM
  83. 11 STUPID
  84. 11 SUBTLE
  85. 11 THEORY
  86. 11 TONGUE
  87. 11 UNABLE
  88. 11 UNFAIR
  89. 11 UNFOLD
  90. 11 UPDATE
  91.  
  92. 15 BEAUTY
  93. 15 BEHALF
  94. 15 BRIGHT
  95. 15 BUDGET
  96. 15 CAMPUS
  97. 15 DEPUTY
  98. 15 EIGHTY
  99. 15 EMPLOY
  100. 15 ENOUGH
  101. 15 FAMOUS
  102. 15 FIGURE
  103. 15 FLIGHT
  104. 15 FOURTH
  105. 15 GUILTY
  106. 15 HUNGRY
  107. 15 HYBRID
  108. 15 MIGHTY
  109. 15 MODIFY
  110. 15 MYSELF
  111. 15 PLUNGE
  112. 15 PUBLIC
  113. 15 PUNISH
  114. 15 SHRIMP
  115. 15 SUBMIT
  116. 15 SYMBOL
  117. 15 TROPHY
  118.  
  119. 27 ACTIVE
  120. 27 ADVICE
  121. 27 ADVISE
  122. 27 COVERS
  123. 27 COVERT
  124. 27 DIVERT
  125. 27 DRIVEN
  126. 27 INTAKE
  127. 27 INVADE
  128. 27 NATIVE
  129. 27 NICKEL
  130. 27 NOVICE
  131. 27 RACKET
  132. 27 RECKON
  133. 27 REVOLT
  134. 27 ROCKET
  135. 27 STREAK
  136. 27 STRIKE
  137. 27 STRIVE
  138. 27 STROKE
  139. 27 TACKLE
  140. 27 TOWARD
  141. 27 TRAVEL
  142. 27 VECTOR
  143. 27 VENDOR
  144. 27 VICTOR
  145. 27 VIOLET
  146.  
  147. 31 BASKET
  148. 31 BROKEN
  149. 31 CAVITY
  150. 31 CONVEY
  151. 31 DONKEY
  152. 31 FLAVOR
  153. 31 GOVERN
  154. 31 GRAVEL
  155. 31 HALVES
  156. 31 LAVISH
  157. 31 MARKET
  158. 31 MOTIVE
  159. 31 PACKET
  160. 31 PICKET
  161. 31 POCKET
  162. 31 PROVEN
  163.  
  164. 31 SHADOW
  165. 31 SHAKEN
  166. 31 SHRINK
  167. 31 SKETCH
  168. 31 SPOKEN
  169. 31 STICKY
  170. 31 STRUCK
  171. 31 SWITCH
  172. 31 THANKS
  173. 31 THRIVE
  174. 31 TRICKY
  175. 31 UNLIKE
  176. 31 UNLOCK
  177. 31 UNVEIL
  178. 31 VANISH
  179. 31 VANITY
  180. 31 VERBAL
  181. 31 VIABLE
  182. 31 VIRTUE
  183. 31 VISUAL
  184. 31 WEALTH
  185. 31 WEAPON
  186. 31 WISDOM
  187.  
  188. 35 BAKERY
  189. 35 BUCKET
  190. 35 BUCKLE
  191. 35 EMBARK
  192. 35 GROWTH
  193. 35 HOCKEY
  194. 35 KNIGHT
  195. 35 MAKEUP
  196. 35 MONKEY
  197. 35 SHRUNK
  198.  
  199. 35 SURVEY
  200. 35 TURKEY
  201. 35 UPLINK
  202. 35 UPTAKE
  203. 35 VERIFY
  204. 35 VOLUME
  205. 35 VOYAGE
  206. 35 WARMTH
  207. 35 WEIGHT
  208. 35 WORTHY
  209.  
  210. 52 CAJOLE
  211. 52 CORTEX
  212. 52 EXOTIC
  213. 52 INJECT
  214. 52 JOSTLE
  215. 52 REJOIN
  216.  
  217. 55 WHISKY
  218.  
  219. 56 ADJUST
  220. 56 BOXCAR
  221. 56 CLIMAX
  222. 56 CLIQUE
  223. 56 EQUALS
  224. 56 EXHORT
  225. 56 EXODUS
  226. 56 EXPAND
  227. 56 EXPORT
  228. 56 FIXATE
  229. 56 ICEBOX
  230. 56 INJURE
  231. 56 JARGON
  232. 56 JINGLE
  233.  
  234. 56 JUNIOR
  235. 56 LIQUOR
  236. 56 MATRIX
  237. 56 OBJECT
  238. 56 QUAINT
  239. 56 QUOTAS
  240. 56 QUOTES
  241. 56 RISQUE
  242. 56 SQUARE
  243. 56 SQUEAL
  244. 56 SQUINT
  245. 56 SYNTAX
  246. 56 TORQUE
  247. 56 TUXEDO
  248.  
  249. 60 DUPLEX
  250. 60 EQUITY
  251. 60 EXPIRY
  252. 60 HATBOX
  253. 60 INFLUX
  254. 60 INJURY
  255. 60 JOYFUL
  256. 60 JUMBLE
  257. 60 JUNGLE
  258.  
  259. 60 OPAQUE
  260. 60 OXYGEN
  261. 60 PIQUET
  262. 60 PLAQUE
  263. 60 PREFIX
  264.  
  265. 60 QUEASY
  266. 60 QUENCH
  267. 60 REFLUX
  268. 60 SPHINX
  269. 60 SQUIRM
  270.  
  271. 76 CERVIX
  272. 76 CONVEX
  273. 76 JACKET
  274. 76 JOVIAL
  275. 76 VORTEX
  276.  
  277. 80 JIGSAW
  278. 80 JOCKEY
  279. 80 SQUEAK
  280.  
  281. 252 LIZARD
  282.  
  283. 256 BRONZE
  284. 256 FROZEN
  285. 256 SCHIZO
  286.  
  287. 256 SLEAZY
  288. 256 SPRITZ
  289. 256 ZENITH
  290.  
  291. 260 FRENZY
  292. 260 GAZEBO
  293. 260 UPSIZE
  294.  
  295. 260 ZEPHYR
  296. 260 ZOMBIE
  297.  
  298. 276 WIZARD
  299.  
  300. 305 QUARTZ
  301. '''.strip()
  302. words = []
  303. for word in all_words.splitlines():
  304.     if ' ' in word:
  305.         words.append(word.split(' ')[-1])
  306. all_words = '\n'.join(words)
  307.  
  308. all_codes = dict([(k,[]) for k in words])
  309. L = len(words)
  310. for z in range(max_level):
  311.     codes = range(L)
  312.     shuffle(codes)
  313.     for word in words:
  314.         all_codes[word].append(codes.pop()+(z*L))
  315. Lz = len(str(z*L))
  316.  
  317. # list of other 6 letter all_words I've excluded from this game...
  318. '''
  319. 3 ACTION
  320. 3 CANDLE
  321. 3 CASINO
  322. 3 CLIENT
  323. 3 CLOSET
  324. 3 CREDIT
  325. 3 DENIAL
  326. 3 DETAIL
  327. 3 DIRECT
  328. 3 DONATE
  329. 3 EDITOR
  330. 3 INSECT
  331. 3 INSERT
  332. 3 ISLAND
  333. 3 LISTEN
  334. 3 LOCATE
  335. 3 NOTICE
  336. 3 REASON
  337. 3 RENTAL
  338. 3 RETAIL
  339. 3 RETAIN
  340. 3 SECOND
  341. 3 SECTOR
  342. 3 SENIOR
  343. 3 SILENT
  344. 3 SOCIAL
  345. 3 STANCE
  346. 3 STRAIN
  347.  
  348. 7 ADMIRE
  349. 7 ALMOST
  350. 7 AROUND
  351. 7 ASPECT
  352. 7 BREAST
  353. 7 CARBON
  354. 7 CARPET
  355. 7 COURSE
  356. 7 COUSIN
  357. 7 CRUISE
  358. 7 DEBRIS
  359. 7 DEPART
  360. 7 DEPICT
  361. 7 DESIGN
  362. 7 DOMAIN
  363. 7 ETHICS
  364. 7 ETHNIC
  365. 7 FACTOR
  366. 7 FISCAL
  367. 7 FRIEND
  368. 7 GARDEN
  369. 7 GARLIC
  370. 7 GLANCE
  371. 7 GOLDEN
  372. 7 HANDLE
  373. 7 IGNORE
  374. 7 INCOME
  375. 7 INMATE
  376. 7 ITSELF
  377. 7 MARINE
  378. 7 MENTAL
  379. 7 MENTOR
  380. 7 MODERN
  381. 7 NATURE
  382. 7 NORMAL
  383. 7 OBTAIN
  384. 7 ORANGE
  385. 7 OTHERS
  386. 7 PARENT
  387. 7 PATROL
  388. 7 PATRON
  389. 7 PENCIL
  390. 7 PERIOD
  391. 7 PERSON
  392. 7 PISTOL
  393. 7 PLANET
  394. 7 POLICE
  395. 7 PRAISE
  396. 7 PRISON
  397. 7 RANDOM
  398. 7 REGAIN
  399. 7 REGION
  400. 7 REMAIN
  401. 7 REMIND
  402. 7 RESIGN
  403. 7 RESULT
  404. 7 RITUAL
  405. 7 SALMON
  406. 7 SCREAM
  407. 7 SCRIPT
  408. 7 SEARCH
  409. 7 SELDOM
  410. 7 SIGNAL
  411. 7 SINGLE
  412. 7 SOFTEN
  413. 7 SOURCE
  414. 7 SPREAD
  415. 7 STABLE
  416. 7 STEADY
  417. 7 STREAM
  418. 7 STRONG
  419. 7 STUDIO
  420. 7 THREAD
  421. 7 TRAGIC
  422. 7 TRIBAL
  423.  
  424. 100 SQUAWK
  425. '''
  426.  
  427. all_finishing_moves = '''
  428. ABDOMINAL STRETCH
  429. ANKLE LOCK
  430. ARM TRIANGLE CHOKE
  431. BEAR HUG
  432. CAMEL CLUTCH
  433. COBRA CLUTCH
  434. CROSS ARMBAR
  435. FIGURE FOUR LEG LOCK
  436. FLYING DOWNWARD ELBOW
  437. FRONT CHINLOCK
  438. FULL NELSON CHOKE
  439. GORY SPECIAL
  440. HALF NELSON CHOKE
  441. HEADLOCK
  442. HEADSCISSORS ARMBAR
  443. LEG LOCK
  444. NELSON HOLD
  445. PILEDRIVER
  446. REVERSE CHINLOCK
  447. STUNNER
  448. THE SLEEPER HOLD
  449. TRIANGLE CHOKE
  450. '''.splitlines()
  451.  
  452. all_regular_moves = '''
  453. Arm Bar
  454. Axe Kick
  455. Backbreaker
  456. Boston Crab
  457. Chest Slap
  458. Chinlock
  459. Chokeslam
  460. Clothesline
  461. Double Punch
  462. Elbow To The Chest
  463. Elbow Uppercut
  464. Flying Knee
  465. Grab And Knee
  466. Guillotine Choke
  467. Head Butt
  468. Heel Kick
  469. Horse Kick
  470. Jumping Double Spin Kick
  471. Kick Flip
  472. Knee
  473. Left Hook
  474. Leg Drop
  475. Lift Up And Throw Down
  476. Low Kick
  477. Pimp Slap
  478. Right Hook
  479. Roundhouse
  480. Short Jump Kick
  481. Shoulder Throw
  482. Side Kick
  483. Spinning Jumpkick
  484. Spinning Punch
  485. Spinning Step Kick
  486. Straight Punch
  487. Suplex
  488. Sweep Kick
  489. Sweep Kick To The Head
  490. Swoop Triple Kick
  491. Two Leg Jump Kick
  492. Uppercut
  493. Wrist Lock
  494. '''.splitlines()
  495.  
  496. all_wrestlers = '''
  497. Abe "The True American" Ruthers
  498. Adam "The Flying Machine" Myweigh
  499. Al "The Drunken Master" Koholic
  500. Andy "The Knock Out" Wyneriss
  501. Arthur "The Crippler" Wrightus
  502. Billy "The Billionaire" Ventura
  503. Bobby "The Big Body" Barrel
  504. Bowen "The Indian Chief" Aero
  505. Cal "The Genius" Quelait
  506. Cliff "The Mountain Man" Angora
  507. Cole "The SubZero" Dasighes
  508. Colin "The Doctor" Syk
  509. Cy "The Robot" Burnett
  510. Dane "The Dancer" Jeross
  511. Daryl "The Darkness" McKnight
  512. Dennis "The Mouth" Trei
  513. Dez "The CopyCat" Parrot
  514. Doug "The Grim Reaper" Graives
  515. Ellis "The Trippy" Dee
  516. Eric "The Savage" Shawn
  517. Gary "The Singer" Oakie
  518. Gil "The Convict" Tiazel
  519. Guido "The Python" Kneatomudge
  520. Hal "The Evil" Elujah
  521. Harry "The Barber" Baldwin
  522. Hayden "The Hunter" Zeke
  523. Herbie "The Health Fanatic" Voor
  524. Ike "The Mime" Intel
  525. Jack "The Rude" Miehawf
  526. Jacques "The Jack Hammer" Hampton
  527. Jason "The Sensation"
  528. Jim "The Acrobatic" Nest
  529. John "The FBI" Smith
  530. Justin "The Psycho" Saiyn
  531. Karmen "The Hardcore" Gogh
  532. Ken "The Mister Nice Guy" Hypleez
  533. Kyle "The Librarian" Phaebett
  534. Lou (The Sneaky) Brikint
  535. Major Payne
  536. Matt "The Sandman" Rus
  537. Michael "The Maestro" Toris
  538. Mike "The Beast" Rodge
  539. Niel "The King" Downe
  540. Noah "The Cross-Eyed" Vale
  541. Ollie "The Superstar" Woods
  542. Ooga "The Neanderthal"
  543. Phil "The Lover-Boy" Hureite
  544. Phil "The Marine" Aisheau
  545. Rex "Mister Demolisher" Holmes
  546. Richard "The Wizard"
  547. Rick "The Cowboy" O'Shea
  548. Ricky "The Hurricane"
  549. Sum-Yen "A La Creme" Gui
  550. Stan "The Gorilla" Da'Phukbak
  551. Teddy "The Killer Bear" Huxley
  552. The Killer Clown
  553. The Legendary
  554. Tyrone "The Typhoon"
  555. Warden "The Mad Man"
  556. '''.splitlines()
  557.  
  558. pts = { 'E':   1,
  559.         'A':   2,
  560.         'I':   3,
  561.         'S':   4,
  562.         'N':   5,
  563.         'T':   6,
  564.         'R':   7,
  565.         'O':   8,
  566.         'L':   9,
  567.         'C':  10,
  568.         'D':  11,
  569.         'U':  12,
  570.         'M':  13,
  571.         'P':  14,
  572.         'Y':  15,
  573.         'G':  16,
  574.         'H':  17,
  575.         'B':  18,
  576.         'F':  19,
  577.         'V':  50,
  578.         'K':  50,
  579.         'W':  50,
  580.         'J': 100,
  581.         'X': 100,
  582.         'Q': 100,
  583.         'Z': 250}
  584.  
  585. '''
  586. peak_score = []
  587. for word in all_words:
  588.     p = []
  589.     for s in word:
  590.         p.append(pts[s])
  591.     p.sort()
  592.     p = sum(p[3:])
  593.     peak_score.append([p,word])
  594. peak_score.sort()
  595. for z in peak_score: print z[0],z[1]
  596. '''
  597.  
  598. def msg(outcome='+++ Work In Progress +++'):
  599.     clear()
  600.    
  601.     tiles = ' '.join(cue)
  602.     print   show.format(
  603.             rounds=rounds,
  604.             score=score,
  605.             opponent=opponent,
  606.             outcome=outcome,
  607.             letters=letters,
  608.             tiles=tiles,
  609.             level=current_level,
  610.             code=str(code).zfill(Lz),
  611.             chances=chances)
  612.     x(1)
  613.     if '*' in outcome:
  614.         raw_input('\n\n\tPress Enter To Continue\n')
  615.  
  616. play = ''
  617. if 1:
  618.     show = '''
  619.     To Restart: Blank Entry
  620.     To Quit: Enter 'QQ'
  621.    
  622.     Solve {rounds} Words To Reach The Final Score
  623.  
  624.     Current Score: {score}
  625.     Rounds Remaining: {chances}
  626.    
  627.     Level: {level} (Multiplier)
  628.     Code Number: {code}
  629.    
  630.         ===========
  631.     >>> {tiles} <<<
  632.         ===========
  633.    
  634.     Attacking: {opponent}
  635.    
  636.     Outcome: {outcome}
  637.    
  638.     [{letters}]
  639.     '''
  640.  
  641.     ask_level = '''
  642.     "Wrestle To Guess The Word"
  643.    
  644.     Auto Select Level: {current_level}
  645.    
  646.     Of 1 to {max_level}... right below, you may choose the level of difficulty in which makes
  647.     for multiplying the score each round and how many code numbers represents each word.
  648.     '''
  649.  
  650. def rnd(z):
  651.     shuffle(z)
  652.     return z[0]
  653.  
  654. def exit():
  655.     return 'qq' in play.lower()
  656.  
  657. all_words = [z.splitlines() for z in all_words.split('\n\n')]
  658. letters = list(pts)
  659. all_letters = ''.join(sorted(letters))
  660. rounds = len(all_words)
  661.  
  662. current_level = 3
  663. seed(game_seed)
  664. while 'qq*' not in play.lower():
  665.     clear()
  666.     print ask_level.format(
  667.         current_level=current_level,
  668.         max_level=max_level)
  669.     level=raw_input('\tEnter Level Here: ').strip()
  670.     try:
  671.         level = int(level)
  672.     except:
  673.         level = current_level
  674.     if not (0 < level < max_level):
  675.         level = current_level
  676.     current_level = level
  677.    
  678.     shuffle(all_words)
  679.     shuffle(all_wrestlers)
  680.     wrestlers = all_wrestlers # temporary solution
  681.     words = [rnd(z) for z in all_words]
  682.     score = 0
  683.     for word in words:
  684.         Xword = word
  685.         letters = all_letters
  686.         chances = 4
  687.         opponent = wrestlers.pop() # ZZZ for random list of fighters
  688.         cue = '.'*6
  689.         regular_moves = all_regular_moves
  690.         finishing_moves = all_finishing_moves
  691.         shuffle(all_regular_moves)
  692.         shuffle(all_finishing_moves)
  693.         t = all_codes[word][:current_level]
  694.         shuffle(t)
  695.         code = t[-1]
  696.        
  697.         msg()
  698.         while 1:
  699.             s = 'To Your Advantage -- '
  700.             play=raw_input('\tEnter Available Letter Here: ').strip()
  701.             if exit():
  702.                 print('\n\n\t*** Game Cancelled ***')
  703.                 play = 'qq*'
  704.                 x(3)
  705.                 break
  706.             elif not play:
  707.                 ans=raw_input("\n\n\t*** To Confirm Restart... Enter 'Y' ***")
  708.                 if 'y' in ans.lower():
  709.                     play = 'qq'
  710.                     clear()
  711.                     print('\n\t*** Game Restarting As Requested... ***')
  712.                     x(3)
  713.                     break
  714.                 else:
  715.                     msg()
  716.             else:
  717.                 play = play[0].upper()
  718.                 if play in letters:
  719.                     if play in list(Xword):
  720.                         L = letters.count('.')
  721.                         if L < 7:
  722.                             score += (pts[play]*(6-L)*current_level)
  723.                         cue = list(cue)
  724.                         cue[word.index(play)] = play
  725.                         cue = ''.join(list(cue))
  726.                         Xword = Xword.replace(play,'.')
  727.                         msg(s+regular_moves.pop())
  728.                     else:
  729.                         chances -= 1
  730.                         s = 'At A Disadvantage -- '
  731.                         if not chances:
  732.                             msg(s+finishing_moves.pop()+' !!!')
  733.                         else:
  734.                             msg(s+regular_moves.pop())
  735.                     letters = letters.replace(play,'.')
  736.                     if Xword.count('.') == 6:
  737.                         msg(s+finishing_moves.pop())
  738.                         x(3)
  739.                         msg("*** 1... 2... 3.... Word Solved, You Won That Match! ***")
  740.                         x(3)
  741.                         break
  742.                     elif not chances:
  743.                         x(3)
  744.                         msg("*** 1... 2... 3... You Lost That Match! ***")
  745.                         x(3)
  746.                         break
  747.                    
  748.                 else:
  749.                     msg('\n\t*** Invalid Entry ***')
  750.                     x(2)
  751.                     msg()
  752.         if exit(): break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement