Text Size
Text Size
Exit Full Screen
Python Mini
Show
Source Code
View Source Code in Full Screen
Open in New Tab
#lets = input('input the 7 letters (1st letter is the required one. example: astingl)') #ans = input('input the answers: (use \n\nhttps://www.wolframalpha.com/input?i=words+made+with+the+letters+'+lets+'\n\n and convert the "words made with only letters a,b,c,d..." section to plain text)') #premade games # January 1st, 2022 #lets = 'camnory' #ans = 'coronary | macaroon | McNamara | Moroccan | Ramayana | acronym | Comoran | mammary | Marmara | Maryann | Monacan | morocco | Myanmar | raccoon | Aramco | arcana | armory | arroyo | Aymara | Canaan | canary | cancan | cannon | Cannon | canyon | cayman | Cayman | cocoon | common | conman | corona | cranny | crayon | Cyrano | macron | mammon | Manama | manana | maraca | maroon | McCray | Monaco | Mormon | noncom | Norman | Ramona | rancor | rococo | Romano | Romany | Aaron | Accra | acorn | Amman | Amoco | Annam | annoy | armor | aroma | array | Arron | Aryan | cacao | Camry | canny | canon | Canon | carny | carom | carry | cocoa | comma | Conan | corny | crony | croon | Macao | macro | mammy | manna | manor | Marco | Marcy | marry | Mayan | mayor | Mayra | McCoy | momma | mommy | Moran | moray | moron | Myrna | Myron | Nancy | nanny | Norma | Occam | Ramon | rayon | Rocco | roman | Ronny | roomy | ammo | Anna | anon | army | Arno | Aron | Cara | Carr | Cary | coca | coco | coma | Como | cony | Cora | corm | corn | Cory | cram | Cray | cyan | Macy | mama | Mann | many | Marc | Mary | Maya | mayo | Mayo | moan | Mona | mono | moon | moor | Moor | morn | Moro | myna | Myra | Nara | narc | nary | NCAA | Nona | noon | Nora | norm | Oman | Omar | Oran | racy | Rama | roam | roan | roar | Roma | room | Rory | Ryan | Yacc | yarn | Amy | Ann | any | arc | arm | cam | can | car | cay | CNN | con | coo | coy | Coy | cry | mac | Mac | mam | man | Man | mar | may | May | mom | moo | Nam | nan | nay | NCO | non | nor | oar | Ono | Ora | Orr | ram | ran | ray | Ray | RCA | Ron | Roy | yam | yon | am | an | ma | MC | Mr | my | no | om | on | or | ya | yo (total: 223)' # Custom! #lets = 'wrnoed-' #ans = 'Dee | deed | deeded | deer | Deere | den | Dene | Deon | dew | do | dodder | doddered | dodo | doe | Doe | doer | don | done | Donn | Donne | donned | Donner | donor | door | doored | Dore | Doreen | Dow | dower | dowered | down | downed | downer | drew | drone | droned | drown | drowned | Ed | Ede | Eden | en | end | ended | endow | endowed | Enron | eon | er | ere | erode | eroded | err | erred | error | ewe | ewer | Ned | nee | need | needed | neon | Nero | new | newed | newer | no | nod | nodded | node | Noe | non | none | noon | nooned | nor | Noreen | now | odd | odder | ode | Oder | odor | odored | on | one | Ono | or | order | ordered | ore | Oreo | Orr | ow | owe | owed | Owen | own | owned | owner | re | red | redden | reddened | redder | redo | redone | redrew | redwood | reed | rend | render | rendered | Rene | Renee | renew | renewed | Reno | renown | renowned | reorder | reordered | rewed | rewedded | reword | reworded | rod | Rod | rode | roded | rodeo | roe | Ron | rondo | rood | row | Rowe | rowed | rower | we | wed | wedded | wedder | wee | weed | weeded | weeder | ween | weened | weer | wen | wend | wended | were | woe | won | wonder | Wonder | wondered | woo | wood | wooded | wooden | woodener | Woodrow | wooed | wooer | word | worded | wore | worn | wow | wowed | wren (total: 174)' #lets = 'a-sngi-' #ans = 'again | Agana | Agassi | aging | agings | Agni | an | Ananias | angina | Ann | Anna | ans | as | Asia | Asian | Asians | assassin | assassins | assign | assigning | assigns | Assisi | gag | gaga | gagging | gaging | gags | gain | gaining | gains | gang | ganging | gangs | gas | gassing | Giannini | gig | gigging | gigs | gin | Gina | ginning | gins | gs | Ian | in | Ina | inn | inning | innings | inns | ins | insignia | insignias | is | Isa | Isis | nag | nagging | nags | nan | nans | NASA | Nina | Nisan | Nissan | sag | saga | Sagan | sagas | sagging | sags | San | Sana | sang | Sang | sangs | saning | sans | sass | Sassanian | sassing | sign | signing | signings | signs | sin | Sinai | sing | singing | sings | sinning | sins | sis | snag | snagging | snags (total: 97)' #lets = 'vciltse' #ans = 'Cecil | Cecile | Celeste | cell | cellist | cellists | cells | Celt | Celtic | Celtics | Celts | cissies | cite | cites | cities | cits | civet | civets | civic | civics | civil | civilities | civvies | clevis | clevises | Clive | cs | eclectic | eclectics | eel | eels | elect | elective | electives | elects | Eli | elicit | elicits | Elise | elite | elites | elitist | elitists | ell | Ellie | Ellis | ells | else | Elsie | elves | Elvis | es | Essie | Estelle | Estes | ET | eve | eves | evict | evicts | evil | evilest | evils | ice | ices | icicle | icicles | iciest | ileitis | ill | illicit | ills | is | Isis | isle | isles | islet | islets | it | its | Ives | ivies | Le | lee | lees | lei | leis | Leslie | less | lessee | lessees | Lessie | lest | let | lets | Lev | levee | levees | level | levelest | levels | Levi | levies | Levis | Levitt | lice | licit | lie | lies | lilies | Lille | Lillie | lilt | lilts | lisle | list | listless | lists | lit | lite | lites | little | Little | littlest | live | liveliest | lives | livest | ls | secs | sect | sects | see | sees | select | selective | selects | sell | sells | selves | sessile | set | sets | sett | settee | settees | settle | settles | setts | Seville | sic | sics | sieve | sieves | sill | sillies | silliest | sills | silt | siltiest | silts | sis | sises | sissies | sissiest | sit | site | sites | sits | sleet | sleetiest | sleets | sleeve | sleeveless | sleeves | slice | slices | sliest | slit | slits | steel | Steele | steelies | steeliest | steels | stet | stets | Steve | Stevie | sties | stile | stiles | still | stillest | stills | stilt | stilts | svelte | sveltest | tee | tees | televise | televises | tell | tellies | tells | tels | Tess | Tessie | test | testes | testicle | testicles | testiest | testis | tests | Tet | Tevet | ti | tic | tics | tie | ties | til | tile | tiles | till | tills | Tilsit | tilt | tilts | title | titles | titlist | titlists | titties | tittle | tittles | ts | tsetse | tsetses | TVs | veil | veils | velvet | velvetiest | velvets | vesicle | vesicles | vessel | vessels | vest | vests | vet | vets | Vic | vice | vices | vie | vies | vile | vilest | ville | villi | vise | vises | visit | visits | vittles | vivisect | vivisects | vs (total: 272)' #lets = 'cxgnsie' #ans = 'exigencies | senescence | exigences | incensing | engining | essences | excesses | excising | exegeses | exegesis | exigence | incenses | incising | niceness | sciences | sexiness | signings | singeing | ciggies | cissies | engines | ensigns | essence | Essenes | excises | geneses | genesis | Genesis | genning | gigging | ginning | ginseng | iciness | incense | incises | innings | ninnies | scening | science | seeings | seining | sensing | signing | singing | sinning | sissies | egging | engine | ensign | Essene | excess | excise | geeing | genies | gneiss | icings | incise | inning | Nicene | nieces | Niseis | nixing | scenes | scenic | seeing | seines | senses | sexing | sieges | singes | Ennis | Essen | Essex | Essie | execs | geese | genes | genie | genii | icing | Nexis | niece | nines | nisei | Nisei | nixes | Nixie | scene | seine | sense | sexes | siege | signs | since | sines | singe | sings | sises | sixes | cine | eggs | exec | exes | gees | gene | Gene | gens | gigs | gins | ices | Ines | Inge | inns | Isis | negs | nice | nine | secs | seen | sees | sens | sics | sign | sine | sing | sins | CNN | egg | ens | gee | gig | gin | ice | inn | ins | nee | nix | see | sex | sic | sin | sis | six | xis | cs | en | es | ex | GE | gs | in | is (total: 152)' #lets = 'ei--rs-' #ans = 'eerie | eerier | Eire | er | ere | Erie | Eries | Eris | err | errs | Erse | es | Essie | ire | ires | iris | Iris | irises | is | Isis | re | Rees | Reese | rise | riser | risers | rises | rs | see | seer | seers | sees | sere | serer | seres | series | sir | Sir | sire | sires | sirree | sirs | Sirs | sis | sises | sissier | sissies (total: 47)' #lets = 'fsldixo' #ans = 'did | Dido | dill | dills | Dix | do | dodo | dodos | doff | doffs | doll | dolls | dos | doss | Fido | fill | fills | filo | fix | Flo | flood | floods | floss | foil | foils | fold | folds | folio | folios | food | foods | fool | fools | fossil | fossils | fox | id | ID | idol | idols | ids | IDs | if | ifs | ill | ills | is | Isis | lid | lido | lidos | lids | lilo | lilos | lo | Lois | loll | lolls | loo | loos | loss | lox | ls | odd | odds | Odis | of | off | offs | oi | oil | oils | old | Oslo | ox | Sid | sill | sills | silo | silos | sis | six | sixfold | slid | so | sod | sods | soil | soils | sol | sold | solid | solidi | solids | Solis | solo | solos | sols | SOS | xis | XL | XXL (total: 102)' #lets = 'msngia-' #ans = 'mismanaging | adds | arras | array | arrays | as | Assad | assay | assays | award | awards | away | aways | awry | dad | Dada | daddy | dads | day | Day | days | draw | draws | dray | drays | dry | dryad | dryads | drys | dyad | radar | radars | rads | raw | ray | Ray | rays | rs | Saar | sad | Sadr | Sara | sass | sassy | saw | saws | say | says | sward | swards | sway | sways | wad | wads | war | ward | wards | wars | Warsaw | wary | was | way | ways | wayward | wry | ya | yard | yards | yaw | yaws (total: 74)' #lets = 'inghto-' #ans = 'gig | gigging | gin | ginning | Gino | Giotto | git | go | going | gong | gonging | goo | goon | got | goth | Goth | hi | high | hinging | hint | hinting | Hinton | hit | hitting | ho | hog | hogging | Hohhot | hon | honing | hoot | hooting | hot | hotting | igniting | ignition | in | ingoing | ingot | inn | inning | innit | inti | into | intoning | ion | it | Ito | nigh | night | ninth | nit | no | noggin | non | noon | nooning | not | nothing | noting | notion | nth | oh | Ohio | oho | oi | on | ongoing | onion | onioning | Ono | onto | ooh | oohing | Otto | thigh | thin | thing | thinning | tho | thong | Thoth | ti | tight | tin | ting | Ting | tinging | tining | tinning | tint | tinting | tithing | Tito | to | tog | togging | Togo | ton | tong | tonging | Toni | tonight | toning | Tonto | too | toot | tooth | tooting | tot | toting | Toto | totting (total: 113)' #lets = 'in--og-' #ans = 'gig | gigging | gin | ginning | Gino | go | going | gong | gonging | goo | goon | in | ingoing | inn | inning | ion | no | noggin | non | noon | nooning | oi | on | ongoing | onion | onioning | Ono (total: 27)' posslets = ['camnory','wrnoed-','a-sngi-','vciltse','cxgnsie','ei--rs-','fsldixo','inghto-','caution'] possans = [ 'coronary | macaroon | McNamara | Moroccan | Ramayana | acronym | Comoran | mammary | Marmara | Maryann | Monacan | morocco | Myanmar | raccoon | Aramco | arcana | armory | arroyo | Aymara | Canaan | canary | cancan | cannon | Cannon | canyon | cayman | Cayman | cocoon | common | conman | corona | cranny | crayon | Cyrano | macron | mammon | Manama | manana | maraca | maroon | McCray | Monaco | Mormon | noncom | Norman | Ramona | rancor | rococo | Romano | Romany | Aaron | Accra | acorn | Amman | Amoco | Annam | annoy | armor | aroma | array | Arron | Aryan | cacao | Camry | canny | canon | Canon | carny | carom | carry | cocoa | comma | Conan | corny | crony | croon | Macao | macro | mammy | manna | manor | Marco | Marcy | marry | Mayan | mayor | Mayra | McCoy | momma | mommy | Moran | moray | moron | Myrna | Myron | Nancy | nanny | Norma | Occam | Ramon | rayon | Rocco | roman | Ronny | roomy | ammo | Anna | anon | army | Arno | Aron | Cara | Carr | Cary | coca | coco | coma | Como | cony | Cora | corm | corn | Cory | cram | Cray | cyan | Macy | mama | Mann | many | Marc | Mary | Maya | mayo | Mayo | moan | Mona | mono | moon | moor | Moor | morn | Moro | myna | Myra | Nara | narc | nary | NCAA | Nona | noon | Nora | norm | Oman | Omar | Oran | racy | Rama | roam | roan | roar | Roma | room | Rory | Ryan | Yacc | yarn | Amy | Ann | any | arc | arm | cam | can | car | cay | CNN | con | coo | coy | Coy | cry | mac | Mac | mam | man | Man | mar | may | May | mom | moo | Nam | nan | nay | NCO | non | nor | oar | Ono | Ora | Orr | ram | ran | ray | Ray | RCA | Ron | Roy | yam | yon | am | an | ma | MC | Mr | my | no | om | on | or | ya | yo (total: 223)', 'Dee | deed | deeded | deer | Deere | den | Dene | Deon | dew | do | dodder | doddered | dodo | doe | Doe | doer | don | done | Donn | Donne | donned | Donner | donor | door | doored | Dore | Doreen | Dow | dower | dowered | down | downed | downer | drew | drone | droned | drown | drowned | Ed | Ede | Eden | en | end | ended | endow | endowed | Enron | eon | er | ere | erode | eroded | err | erred | error | ewe | ewer | Ned | nee | need | needed | neon | Nero | new | newed | newer | no | nod | nodded | node | Noe | non | none | noon | nooned | nor | Noreen | now | odd | odder | ode | Oder | odor | odored | on | one | Ono | or | order | ordered | ore | Oreo | Orr | ow | owe | owed | Owen | own | owned | owner | re | red | redden | reddened | redder | redo | redone | redrew | redwood | reed | rend | render | rendered | Rene | Renee | renew | renewed | Reno | renown | renowned | reorder | reordered | rewed | rewedded | reword | reworded | rod | Rod | rode | roded | rodeo | roe | Ron | rondo | rood | row | Rowe | rowed | rower | we | wed | wedded | wedder | wee | weed | weeded | weeder | ween | weened | weer | wen | wend | wended | were | woe | won | wonder | Wonder | wondered | woo | wood | wooded | wooden | woodener | Woodrow | wooed | wooer | word | worded | wore | worn | wow | wowed | wren (total: 174)', 'again | Agana | Agassi | aging | agings | Agni | an | Ananias | angina | Ann | Anna | ans | as | Asia | Asian | Asians | assassin | assassins | assign | assigning | assigns | Assisi | gag | gaga | gagging | gaging | gags | gain | gaining | gains | gang | ganging | gangs | gas | gassing | Giannini | gig | gigging | gigs | gin | Gina | ginning | gins | gs | Ian | in | Ina | inn | inning | innings | inns | ins | insignia | insignias | is | Isa | Isis | nag | nagging | nags | nan | nans | NASA | Nina | Nisan | Nissan | sag | saga | Sagan | sagas | sagging | sags | San | Sana | sang | Sang | sangs | saning | sans | sass | Sassanian | sassing | sign | signing | signings | signs | sin | Sinai | sing | singing | sings | sinning | sins | sis | snag | snagging | snags (total: 97)', 'Cecil | Cecile | Celeste | cell | cellist | cellists | cells | Celt | Celtic | Celtics | Celts | cissies | cite | cites | cities | cits | civet | civets | civic | civics | civil | civilities | civvies | clevis | clevises | Clive | cs | eclectic | eclectics | eel | eels | elect | elective | electives | elects | Eli | elicit | elicits | Elise | elite | elites | elitist | elitists | ell | Ellie | Ellis | ells | else | Elsie | elves | Elvis | es | Essie | Estelle | Estes | ET | eve | eves | evict | evicts | evil | evilest | evils | ice | ices | icicle | icicles | iciest | ileitis | ill | illicit | ills | is | Isis | isle | isles | islet | islets | it | its | Ives | ivies | Le | lee | lees | lei | leis | Leslie | less | lessee | lessees | Lessie | lest | let | lets | Lev | levee | levees | level | levelest | levels | Levi | levies | Levis | Levitt | lice | licit | lie | lies | lilies | Lille | Lillie | lilt | lilts | lisle | list | listless | lists | lit | lite | lites | little | Little | littlest | live | liveliest | lives | livest | ls | secs | sect | sects | see | sees | select | selective | selects | sell | sells | selves | sessile | set | sets | sett | settee | settees | settle | settles | setts | Seville | sic | sics | sieve | sieves | sill | sillies | silliest | sills | silt | siltiest | silts | sis | sises | sissies | sissiest | sit | site | sites | sits | sleet | sleetiest | sleets | sleeve | sleeveless | sleeves | slice | slices | sliest | slit | slits | steel | Steele | steelies | steeliest | steels | stet | stets | Steve | Stevie | sties | stile | stiles | still | stillest | stills | stilt | stilts | svelte | sveltest | tee | tees | televise | televises | tell | tellies | tells | tels | Tess | Tessie | test | testes | testicle | testicles | testiest | testis | tests | Tet | Tevet | ti | tic | tics | tie | ties | til | tile | tiles | till | tills | Tilsit | tilt | tilts | title | titles | titlist | titlists | titties | tittle | tittles | ts | tsetse | tsetses | TVs | veil | veils | velvet | velvetiest | velvets | vesicle | vesicles | vessel | vessels | vest | vests | vet | vets | Vic | vice | vices | vie | vies | vile | vilest | ville | villi | vise | vises | visit | visits | vittles | vivisect | vivisects | vs (total: 272)', 'exigencies | senescence | exigences | incensing | engining | essences | excesses | excising | exegeses | exegesis | exigence | incenses | incising | niceness | sciences | sexiness | signings | singeing | ciggies | cissies | engines | ensigns | essence | Essenes | excises | geneses | genesis | Genesis | genning | gigging | ginning | ginseng | iciness | incense | incises | innings | ninnies | scening | science | seeings | seining | sensing | signing | singing | sinning | sissies | egging | engine | ensign | Essene | excess | excise | geeing | genies | gneiss | icings | incise | inning | Nicene | nieces | Niseis | nixing | scenes | scenic | seeing | seines | senses | sexing | sieges | singes | Ennis | Essen | Essex | Essie | execs | geese | genes | genie | genii | icing | Nexis | niece | nines | nisei | Nisei | nixes | Nixie | scene | seine | sense | sexes | siege | signs | since | sines | singe | sings | sises | sixes | cine | eggs | exec | exes | gees | gene | Gene | gens | gigs | gins | ices | Ines | Inge | inns | Isis | negs | nice | nine | secs | seen | sees | sens | sics | sign | sine | sing | sins | CNN | egg | ens | gee | gig | gin | ice | inn | ins | nee | nix | see | sex | sic | sin | sis | six | xis | cs | en | es | ex | GE | gs | in | is (total: 152)', 'eerie | eerier | Eire | er | ere | Erie | Eries | Eris | err | errs | Erse | es | Essie | ire | ires | iris | Iris | irises | is | Isis | re | Rees | Reese | rise | riser | risers | rises | rs | see | seer | seers | sees | sere | serer | seres | series | sir | Sir | sire | sires | sirree | sirs | Sirs | sis | sises | sissier | sissies (total: 47)', 'did | Dido | dill | dills | Dix | do | dodo | dodos | doff | doffs | doll | dolls | dos | doss | Fido | fill | fills | filo | fix | Flo | flood | floods | floss | foil | foils | fold | folds | folio | folios | food | foods | fool | fools | fossil | fossils | fox | id | ID | idol | idols | ids | IDs | if | ifs | ill | ills | is | Isis | lid | lido | lidos | lids | lilo | lilos | lo | Lois | loll | lolls | loo | loos | loss | lox | ls | odd | odds | Odis | of | off | offs | oi | oil | oils | old | Oslo | ox | Sid | sill | sills | silo | silos | sis | six | sixfold | slid | so | sod | sods | soil | soils | sol | sold | solid | solidi | solids | Solis | solo | solos | sols | SOS | xis | XL | XXL (total: 102)', 'gig | gigging | gin | ginning | Gino | Giotto | git | go | going | gong | gonging | goo | goon | got | goth | Goth | hi | high | hinging | hint | hinting | Hinton | hit | hitting | ho | hog | hogging | Hohhot | hon | honing | hoot | hooting | hot | hotting | igniting | ignition | in | ingoing | ingot | inn | inning | innit | inti | into | intoning | ion | it | Ito | nigh | night | ninth | nit | no | noggin | non | noon | nooning | not | nothing | noting | notion | nth | oh | Ohio | oho | oi | on | ongoing | onion | onioning | Ono | onto | ooh | oohing | Otto | thigh | thin | thing | thinning | tho | thong | Thoth | ti | tight | tin | ting | Ting | tinging | tining | tinning | tint | tinting | tithing | Tito | to | tog | togging | Togo | ton | tong | tonging | Toni | tonight | toning | Tonto | too | toot | tooth | tooting | tot | toting | Toto | totting (total: 113)', 'acacia | account | accountant | act | action | Acton | actuation | Ainu | an | Anacin | anion | anionic | Anita | Ann | Anna | annotation | annuitant | annunciation | Annunciation | anoint | anon | ant | anti | antic | Anton | Antonia | Antonio | at | attain | attic | Attic | Attica | auction | aunt | auto | cacao | cacti | Cain | can | Canaan | cancan | Cancun | cannon | Cannon | cannot | canon | Canon | cant | cantata | canto | canton | Cantu | cat | catatonia | catatonic | cation | cationic | Cato | Catt | caution | ciao | Cincinnati | citation | CNN | coat | coca | cocci | coco | cocoa | coconut | cocoon | coin | con | Conan | concoct | concoction | conic | connotation | contact | contain | continua | continuation | coo | coot | cot | Cotonou | cotton | Cotton | count | cut | cutout | Iaccoca | Ian | icon | iconic | in | Ina | inaction | Inca | incant | incantation | initiation | inn | innit | Inonu | intact | inti | into | intonation | intuit | intuition | Inuit | ion | Iona | Ionian | ionic | Ionic | iota | IOU | it | Ito | nan | Nat | nation | NCAA | NCO | niacin | Nina | nit | Nita | no | non | Nona | nonunion | noon | not | notation | notion | noun | nu | nun | nuncio | nut | nutation | oat | octant | octonion | oi | on | onion | Ono | onto | Otto | out | outta | ta | tacit | taco | tact | tactic | tactician | Tainan | taint | tan | Tana | Tania | tannin | Tao | tat | tattoo | tau | taunt | taut | ti | Tia | tic | tin | Tina | tint | titan | titanic | Titanic | Titian | Titicaca | Tito | to | toccata | ton | Toni | Tonia | tonic | Tonto | too | toot | tot | Toto | toucan | tout | tuition | tun | tuna | tunic | tut | Tut | tutti | tutu | unction | uncut | uni | union | unit | unto (total: 212)' ] from random import randint temp = randint(0,len(posslets)) lets = posslets[temp] ans = possans[temp] got = [] k = 0 b = 0 rot = [0,0] allrot = 0 textbox = '' camx = 0.0 mb = False extrawidth = 0 slide = 0 score = 0 pangs = 0 hintsup = False bigno = '' perfec = 0 perstr = '' binglist = [] maxlen = 0 startswith = {} numlets = 7 #impement colortimer = 60 targetcolor = [255,255,255] actualcolor = [255,255,255] honey1 = [247, 218, 33] #f7da21 honey2 = [215, 170, 1] #d7aa01 for i in lets: if i == '-': numlets -= 1 class Falling: instances = [] def __init__(self,txt,x,y,r,vx,vy,vr,colored=True): self.txt = txt self.x = x self.y = y self.r = r self.vx = vx self.vy = vy self.vr = vr self.colored = colored Falling.instances.append(self) keys = [0,0,0] def ifPangram(inp): temp = 0 for i in lets: if i in inp: temp += 1 if temp == numlets: return True else: return False hexes = [] for i in lets: hexes.append([i.upper(),0,0,0])#name len rot while '(' in ans and k < 1000: ans = ans[:len(ans)-1] k += 1 ans = ans[:len(ans)-1] ans = ans.split(' | ') answers = [] for i in range(len(ans)): if len(ans[i]) > 3 and lets[0] in ans[i] and ans[i] not in answers and ans[i] == ans[i].lower(): answers.append(ans[i]) totalsc = 0.0 for i in answers: if len(i) == 4: totalsc += 1 elif ifPangram(i): totalsc += len(i) + numlets pangs += 1 if len(i) == numlets: perfec += 1 perstr = ' ('+str(perfec)+" Perfect)" else: totalsc += len(i) if i[0] not in binglist: binglist.append(i[0]) if len(i) > maxlen: maxlen = len(i) if startswith.has_key(i[:2]): startswith[i[:2]] += 1 else: startswith.update({i[:2]:1}) if len(binglist) == numlets: bigno = ', BINGO' ranks = [0,totalsc*.02,totalsc*.05,totalsc*.08,totalsc*.15,totalsc*.25,totalsc*.4,totalsc*.5,totalsc*.7,totalsc] scorepercents = [0.0,.02,.05,.08,.15,.25,.4,.5,.7,1.0] #print answers #got = answers from processing import * from math import cos, sin, ceil from random import uniform, shuffle def setup(): size(500,550) def bee(x,y): translate(x,y) fill(0) ellipse(-10,0,20,20) ellipse(10,0,20,20) rect(-10,-10,20,20) fill(247, 218, 33) rect(-10,-8,5,16) rect(-3,-8,6,16) rect(5,-8,5,16) fill(0xa0ffffff) ellipse(0,16,20,30) ellipse(0,-16,20,30) def keyPressed(): global hexes, textbox, keys, got, slide, score, targetcolor if not hintsup: if keyboard.key.lower() in lets: for i in hexes: if i[0] == keyboard.key.upper(): i[3] = 20 i[1] = 20 i[2] = 0 if keyboard.key.lower() in ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']: textbox += keyboard.key.lower() if keyboard.keyCode == LEFT: if len(textbox) > 0: textbox = textbox[:len(textbox)-1] keys[0] = 20 if keyboard.keyCode == 10 and len(textbox) > 0: keys[1] = 20 for i in hexes: i[2] = 0 i[1] = -20 i[3] = 20 if len(textbox) < 4: Falling('Too Short',0,250,0,uniform(-1,1),-5,uniform(PI/-240,PI/240),False) else: notdid = True for i in textbox: if i.lower() not in lets: notdid = False Falling('Bad Letters',0,250,0,uniform(-1,1),-5,uniform(PI/-240,PI/240),False) break if notdid: if lets[0] not in textbox: Falling('Missing Center Letter',0,250,0,uniform(-1,1),-5,uniform(PI/-240,PI/240),False) elif textbox not in answers: Falling('Not in Word List',0,250,0,uniform(-1,1),-5,uniform(PI/-240,PI/240),False) elif textbox in got: Falling('Already Found',0,250,0,uniform(-1,1),-5,uniform(PI/-240,PI/240),False) if textbox in answers and textbox not in got: got.append(textbox) if len(textbox) == 4: Falling('Good! +1',0,250,0,uniform(-1,1),-7,uniform(PI/-360,PI/360),False) score += 1 elif ifPangram(textbox): Falling('Pangram! +'+str(len(textbox)+7),0,250,0,uniform(-1,1),-7,uniform(PI/-360,PI/360),False) score += len(textbox) + numlets elif len(textbox) in [5,6]: Falling('Nice! +'+str(len(textbox)),0,250,0,uniform(-1,1),-7,uniform(PI/-360,PI/360),False) score += len(textbox) else: Falling('Awesome! +'+str(len(textbox)),0,250,0,uniform(-1,1),-7,uniform(PI/-360,PI/360),False) score += len(textbox) got.sort() for i in textbox: for j in hexes: if j[0].lower() == i: j[1] += -30 else: Falling(textbox.upper(),0,-200,0,uniform(-1,1),-5,uniform(PI/-80,PI/80)) textbox = '' if keyboard.keyCode == UP: slide = 22.0 if keyboard.keyCode == DOWN: slide = -22.0 def mousePressed(): global allrot, mb, hintsup mb = True if ((mouse.x-(250-camx*2))**2+(mouse.y-440)**2)**.5 <= 30: keys[2] = -15 rot[1] = 20 allrot = 0 if touching(960+(camx/250*(250+extrawidth))*-2,10,mouse.x,mouse.y,30,30,0,0): if not hintsup: hintsup = True else: hintsup = False def mouseReleased(): global mb mb = False def touching(x1,y1,x2,y2,sx1,sy1,sx2,sy2): if x1+sx1 >= x2 and x1 <= x2+sx2 and y1+sy1 >= y2 and y1 <= y2+sy2: return True else: return False def mapArd(x, in_min, in_max, out_min, out_max): return float((x - in_min) * (out_max - out_min)) / float((in_max - in_min) + out_min) def hone(var,target,step): if var < step+target and var > target-step and var != target: var = target elif var > target: var -= step elif var < target: var += step return var def exphone(var,target,mult,snap): if var < snap+target and var > target-snap and var != target: var = target else: var += (target-var)/float(mult) return var def outline(texta,px,py,weight=2,outcolor=0): fill(outcolor); w = weight/2 for x in range(weight): for y in range(weight): text(texta, px-x+w,py-y+w) fill(*honey1); text(texta, px,py); def polygon3D(x,y,radius,npoints,rotation=0,depth=30): angle = TAU / npoints rotation = rotation % angle a = rotation points = [] while a < TAU: sx = x + cos(a) * radius sy = y + sin(a) * radius points.append([sx, sy]) a += angle sortp = [] pointsx = points[:] for i in points: maxy = None for i in pointsx: if maxy == None: maxy = i elif i[1] < maxy[1]: maxy = i sortp.append(maxy) pointsx.remove(maxy) for j in sortp: i = points.index(j) beginShape(); vertex(points[i][0],points[i][1]) vertex(points[i][0],points[i][1]+depth) vertex(points[(i+1)%(len(points))][0],points[(i+1)%(len(points))][1]+depth) vertex(points[(i+1)%(len(points))][0],points[(i+1)%(len(points))][1]) endShape(CLOSE); beginShape() for i in points: vertex(i[0],i[1]) endShape(CLOSE); def draw(): global b, hexes, keys, rot, allrot, lets, camx, extrawidth, slide, score, targetcolor, actualcolor, colortimer, honey1, honey2 if actualcolor != targetcolor: for i in range(3): actualcolor[i] = hone(actualcolor[i],targetcolor[i],1) if score >= ranks[9]: honey1 = [247, 218, 33] #f7da21 honey2 = [215, 170, 1] #d7aa01 targetcolor = [255, 218, 123] if colortimer == 0: colortimer = 60 actualcolor = [255,230,140] for i in hexes: i[1] -= 10 colortimer -= 1 elif score >= ranks[8]: targetcolor = [170,170,255] if colortimer == 0: colortimer = 60 actualcolor = [200,195,255] colortimer -= 1 honey1 = [actualcolor[0]-40,actualcolor[1]-40,actualcolor[2]-40] honey2 = [actualcolor[0]*.7,actualcolor[1]*.7,actualcolor[2]*.7] background(*actualcolor) if score >= ranks[9]: for i in range(6): pushMatrix() translate(250+camx*-2,250) rotate(b) rotate(TAU*i/6) bee(0,200+colortimer/8) popMatrix() extrawidth = ((len(got)-1)/13+1)*60 - 180 if extrawidth < 0: extrawidth = 0 for i in hexes: #i[2] += PI/700 #passive spin b += PI/2000 if i[0] == '-': i[1] = 20 i[2] = b else: if i[3] > 0: i[3] -= 1 i[2] += PI/sum(range(20))*i[3] if i[1] != 0: i[1] = exphone(i[1],0,5,1) for i in range(len(keys)): if keys[i] != 0: keys[i] = exphone(keys[i],0,5,1) pushMatrix() translate((camx/250*(250+extrawidth))*-2,0) for i in range(len(scorepercents)): if score >= ranks[i]: fill(*honey1) stroke(*honey2) else: fill(0xffe6e6e6) stroke(0xffbbbbbb) line(550+(300*scorepercents[i]),10,550+(300*scorepercents[i]),25) ellipse(550+(300*scorepercents[i]),10,6,6) fill(255) stroke(0xffbbbbbb) rect(550,50,400+extrawidth*2,450,10,10,10,10) rect(550,20,300,10,10,10,10,10) if touching(960+(camx/250*(250+extrawidth))*-2,10,mouse.x,mouse.y,30,30,0,0): fill(0xffe6e6e6) rect(960,10,30,30,8,8,8,8) stroke(0) strokeWeight(2) line(970,30,980,20) line(980,30,980,20) line(970,20,980,20) strokeWeight(1) fill(*honey1) stroke(*honey2) if score != 0: rect(550,20,300*(score/totalsc),10,10,10,10,10) textSize(12) textAlign(CENTER,CENTER) fill(0) text(str(score),550+300*(score/totalsc),37) stroke(0xffbbbbbb) textSize(15) fill(0) textAlign(BOTTOM,LEFT) if score < ranks[1]: text('Beginner',875,30) elif score < ranks[2]: text('Good Start',875,30) elif score < ranks[3]: text('Moving Up',875,30) elif score < ranks[4]: text('Good',875,30) elif score < ranks[5]: text('Solid',875,30) elif score < ranks[6]: text('Nice',875,30) elif score < ranks[7]: text('Great',875,30) elif score < ranks[8]: text('Amazing',875,30) elif score < ranks[9]: text('Genius',875,30) elif score == ranks[9]: text('Queen Bee',875,30) else: text('what',875,30) if len(got) != 1: text('You have found '+str(len(got))+' words',570,75) else: text('You have found 1 word',570,75) for i in range(len(got)): text(got[i].title(),570+(i/13*120),110+(i%13)*30) rect(570+(i/13*120),117+(i%13)*30,100,0) textAlign(CENTER,CENTER) translate(250,250) fill(0xffe6e6e6) textSize(35) if hexes[1][0] == '-':fill(0xff888888); k = 9+allrot; k1 = cos(k*PI/6) * 100; k2 = sin(k*PI/6) * 100; polygon3D(k1,k2+hexes[1][1],50,6,hexes[1][2],30-hexes[1][1]) fill(0);text(hexes[1][0],k1,k2+hexes[1][1]);fill(0xffe6e6e6); if hexes[2][0] == '-': fill(0xff888888); k = 7+allrot; k1 = cos(k*PI/6) * 100; k2 = sin(k*PI/6) * 100; polygon3D(k1,k2+hexes[2][1],50,6,hexes[2][2],30-hexes[2][1]) fill(0);text(hexes[2][0],k1,k2+hexes[2][1]);fill(0xffe6e6e6); if hexes[3][0] == '-': fill(0xff888888); k = 11+allrot; k1 = cos(k*PI/6) * 100; k2 = sin(k*PI/6) * 100; polygon3D(k1,k2+hexes[3][1],50,6,hexes[3][2],30-hexes[3][1]) fill(0);text(hexes[3][0],k1,k2+hexes[3][1]);fill(0xffe6e6e6); fill(*honey1); stroke(*honey2) polygon3D(0,hexes[0][1],50,6,hexes[0][2]+allrot,30-hexes[0][1]) fill(0);text(hexes[0][0],0,hexes[0][1]);fill(0xffe6e6e6);#print name of hex if hexes[4][0] == '-': fill(0xff888888); stroke(0xffbbbbbb) k = 1+allrot; k1 = cos(k*PI/6) * 100; k2 = sin(k*PI/6) * 100; polygon3D(k1,k2+hexes[4][1],50,6,hexes[4][2],30-hexes[4][1]) fill(0);text(hexes[4][0],k1,k2+hexes[4][1]);fill(0xffe6e6e6); if hexes[5][0] == '-': fill(0xff888888); k = 5+allrot; k1 = cos(k*PI/6) * 100; k2 = sin(k*PI/6) * 100; polygon3D(k1,k2+hexes[5][1],50,6,hexes[5][2],30-hexes[5][1]) fill(0);text(hexes[5][0],k1,k2+hexes[5][1]);fill(0xffe6e6e6); k = 3+allrot; k1 = cos(k*PI/6) * 100; k2 = sin(k*PI/6) * 100; if hexes[6][0] == '-': fill(0xff888888); polygon3D(k1,k2+hexes[6][1],50,6,hexes[6][2],30-hexes[6][1]) fill(0);text(hexes[6][0],k1,k2+hexes[6][1]); fill(0xffe6e6e6) beginShape() k = 2; k1 = cos(k*PI/6) * 120; k2 = sin(k*PI/6) * 120; vertex(k1,k2+keys[1]) vertex(k1+100,k2+keys[1]) k3 = cos(k*PI/6) * 170; k4 = sin(k*PI/6) * 170; vertex(k3+100,k4+keys[1]) vertex(k3,k4+keys[1]) endShape(CLOSE) beginShape() vertex(k3,k4+30) vertex(k3+100,k4+30) vertex(k3+100,k4+keys[1]) vertex(k3,k4+keys[1]) endShape(CLOSE) beginShape() vertex(k3,k4+keys[1]) vertex(k1,k2+keys[1]) vertex(k1,k2+30) vertex(k3,k4+30) endShape(CLOSE) fill(0) textSize(25) text('Enter',(k1+k3)/2+50,(k2+k4)/2+keys[1]) fill(0xffe6e6e6) beginShape() k = 4; k1 = cos(k*PI/6) * 120; k2 = sin(k*PI/6) * 120; vertex(k1,k2+keys[0]) vertex(k1-100,k2+keys[0]) k3 = cos(k*PI/6) * 170; k4 = sin(k*PI/6) * 170; vertex(k3-100,k4+keys[0]) vertex(k3,k4+keys[0]) endShape(CLOSE) beginShape() vertex(k3,k4+30) vertex(k3-100,k4+30) vertex(k3-100,k4+keys[0]) vertex(k3,k4+keys[0]) endShape(CLOSE) beginShape() vertex(k3,k4+keys[0]) vertex(k1,k2+keys[0]) vertex(k1,k2+30) vertex(k3,k4+30) endShape(CLOSE) fill(0) textSize(25) text('Delete',(k1+k3)/2-50,(k2+k4)/2+keys[0]) fill(0xffe6e6e6) polygon3D(0,190-keys[2],30,7,rot[0],20+keys[2]) rot[0] += PI/500 if rot[1] > 0: rot[1] -= 1 rot[0] += PI/sum(range(20))*rot[1] allrot += PI/sum(range(20))*rot[1]*2 allrot %= TAU/3 temp = [] for i in lets[1:]: temp.append(i) shuffle(temp) lets = lets[0] for i in temp: lets += i for i in range(6): hexes[i+1][0] = temp[i].upper() for i in hexes: if i[0] != '-': i[2] = 0 if ((mouse.x-(250-(camx/250*(250+extrawidth))*2))**2+(mouse.y-440)**2)**.5 <= 30: keys[2] += 2 textSize(35) k = textWidth(textbox.upper())/-2.0 for i in textbox.upper(): if i.lower() in lets: fill(0) if i.lower() == lets[0]: fill(*honey1) else: fill(0xffdcdcdc) k += textWidth(i)/2.0 if score >= ranks[8] and i.lower() == lets[0]: outline(i,k,-200,2) else:text(i,k,-200) k += textWidth(i)/2.0 for i in Falling.instances: pushMatrix() i.x += i.vx i.y += i.vy i.vy += .5 i.r += i.vr translate(i.x,i.y) rotate(i.r) if i.colored: k = textWidth(i.txt)/-2.0 for j in i.txt: if j.lower() in lets: fill(0) if j.lower() == lets[0]: fill(*honey1) else: fill(0xffdcdcdc) k += textWidth(j)/2.0 if score >= ranks[8] and j.lower() == lets[0]: outline(j,k,0,2) else:text(j,k,0) k += textWidth(j)/2.0 else: fill(0) text(i.txt,0,0) popMatrix() if i.y > 1000: Falling.instances.remove(i) if mb and touching(mouse.x,mouse.y,camx,515,0,0,250,35) and not hintsup: camx += float(mouse.x-mouse.px) if slide != 0: camx += slide slide = hone(slide,0,1) if camx < 0: camx = 0 elif camx > 250: camx = 250 noStroke() fill(0xffe6e6e6) popMatrix() rect(0,535,500,15) fill(0xffbbbbbb) rect(camx,535,250,15) if hintsup: fill(250) stroke(0xffbbbbbb) rect(40,40,420,470,5,5,5,5) fill(0) textAlign(TOP,LEFT) textSize(15) text("BEESDAY - Hi busy bees! Welcome to today's Spelling\nBee forum.",50,60) textSize(13) text("WORDS: "+str(len(answers))+", POINTS: "+str(int(totalsc))+", PANGRAMS: "+str(pangs)+perstr+bigno,50,110) textSize(20) text("Spelling Bee Grid",50,150) textSize(15) tmpi = 0 for i in range(7): if lets[i] != '-': text(lets[i].upper()+":",50,190+tmpi*20) tmpi += 1 text("*:",50,190+(tmpi)*20) rect(73,173,(maxlen-2)*25,1) rect(73,173,1,(tmpi+1)*20) for i in range(maxlen-3): text(str(i+4),78+i*25,170) allthem = [] tmpi = 0 for j in range(7): if lets[j] != '-': temp = 0 for cycle in answers: if cycle[0] == lets[j] and len(cycle) == i+4: temp += 1 allthem.append(temp) if temp == 0: temp = '-' text(str(temp),80+i*25,190+tmpi*20) tmpi += 1 text(str(sum(allthem)),80+i*25,190+tmpi*20) text('*',105+i*25,170) allthem = [] tmpi = 0 for j in range(7): if lets[j] != '-': temp = 0 for cycle in answers: if cycle[0] == lets[j]: temp += 1 allthem.append(temp) if temp == 0: temp = '-' text(str(temp),105+i*25,190+tmpi*20) tmpi += 1 text(str(sum(allthem)),105+i*25,190+tmpi*20) textSize(20) text("Two Letter List",50,360) textSize(15) temp = 0 temp2 = 0 for i in lets: did = False for j in lets: if startswith.has_key(i+j): did = True text(i.upper()+j.upper()+'-'+str(startswith[i+j]),50+temp2,385+temp) temp2 += textWidth(i.upper()+j.upper()+'-'+str(startswith[i+j])) + 10 if did: temp += 20 temp2 = 0 run()
spellingbee.py
( around 625 lines python code )
Published By:
luyfru
Published on
2023-09-21T18:50:00Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here