Avec les anagrammes (angl. : scramble), les instructions sur les expressions régulières n'ont pas grande utilité puisque les expressions en questions sont «irrégulières»...
2) Tu sélectionnes correctement la liste des 10 mots (sans prendre plus au-dessus de cette liste sinon ça ne va pas le faire!)
Et le tour est joué car, entre le moment où tu as copié et le moment où tu as collé, le code s'est chargé de faire le travail ! (Et il ne met pas trois heures car j'ai utilisé une
PS: Grâce au code plus haut, la wordlist est intégrée.
Code : Tout sélectionner
DataSection
Data.S "html:)", "121212", "131313", "123123", "654321"
Data.S "8675309", "666666", "696969", "888888", "1234567"
Data.S "21122112", "12345678", "asdfjkl;", "hal9000"
Data.S "bond007", "ncc1701d", "ncc1701e", "ncc1701"
Data.S "thx1138", "a12345", "abcd1234", "1234qwer", "1a2b3c"
Data.S "1q2w3e", "test123", "1p2o3i", "puppy123", "kitten12"
Data.S "qwerty12", "john316", "apollo13", "ne1469", "amanda1"
Data.S "mazda1", "angela1", "alpha1", "sarah1", "nirvana1"
Data.S "bubba1", "scuba1", "rambo1", "charlie1", "david1"
Data.S "digital1", "dragon1", "honda1", "shadow1", "eagle1"
Data.S "freak1", "james1", "1sanjose", "apple1", "master1"
Data.S "happy1", "martin1", "jason1", "larry1", "number1"
Data.S "robert1", "soccer1", "direct1", "chester1", "welcome1"
Data.S "french1", "hockey1", "chevy1", "scooter1", "chris1"
Data.S "lucky1", "teddy1", "phoenix1", "hello1", "julie1"
Data.S "kevin1", "pookie1", "viper1", "jenny1", "jesus1"
Data.S "kelly1", "money1", "mouse1", "sting1", "justin1"
Data.S "molly1", "sunny1", "front242", "jordan23", "2welcome"
Data.S "h2opolo", "bird33", "4runner", "babylon5", "star69"
Data.S "ib6ub9", "america7", "seven7", "number9", "porsche9"
Data.S "barbara", "database", "banana", "bananas", "canada"
Data.S "jamaica", "amanda", "valhalla", "samantha", "yamaha"
Data.S "natasha", "alaska", "tamara", "zapata", "avatar"
Data.S "basketba", "baseball", "basebal", "bastard"
Data.S "nebraska", "banane", "abigail", "sabrina", "batman"
Data.S "cocacola", "cascade", "cardinal", "claudia"
Data.S "packard", "cannonda", "apache", "america", "canela"
Data.S "camera", "caesar", "warcraft", "catalog", "chapman"
Data.S "zachary", "alicia", "patricia", "carolina", "nicarao"
Data.S "captain", "nautica", "pascal", "rascal", "camaro"
Data.S "nascar", "deadhead", "adidas", "alexande", "airhead"
Data.S "alexandr", "andrea", "gandalf", "grandma", "happyday"
Data.S "indiana", "paladin", "miranda", "adrian", "dakota"
Data.S "dallas", "mayday", "pandora", "sandra", "xanadu"
Data.S "angela", "margaret", "stargate", "savage", "gateway"
Data.S "athena", "ariane", "pearljam", "maryjane", "oatmeal"
Data.S "pamela", "pantera", "vanessa", "graymail", "iguana"
Data.S "jaguar", "galaxy", "gasman", "hannah", "hawaii"
Data.S "mariah", "jonathan", "marshal", "martha", "nathan"
Data.S "italia", "aikman", "saskia", "vanilla", "mailman"
Data.S "animal", "animals", "impala", "attila", "marina"
Data.S "mariposa", "nirvana", "arizona", "joanna", "january"
Data.S "lakota", "avalon", "alyssa", "yomama", "montana"
Data.S "mantra", "tazman", "tarzan", "starwars", "bobcat"
Data.S "badboy", "barbie", "babies", "basketb", "rabbit"
Data.S "bamboo", "rebecca", "abcdef", "abcdefg", "blackie"
Data.S "excalibu", "campbell", "tacobell", "bigmac"
Data.S "jsbach", "columbia", "buddha", "badger", "butthead"
Data.S "bradley", "brenda", "bernard", "ladybug", "diablo"
Data.S "blizzard", "brandi", "bandit", "brandon", "brandy"
Data.S "beagle", "isabelle", "elizabet", "beanie", "beatles"
Data.S "webmaste", "beaner", "beaver", "fireball", "beautifu"
Data.S "gabriell", "gabriel", "poohbear", "bertha", "benjamin"
Data.S "bailey", "beavis", "basket", "blaster", "albert"
Data.S "blazer", "barney", "strawber", "braves", "buffalo"
Data.S "football", "softball", "footbal", "foobar", "bigman"
Data.S "gambit", "global", "malibu", "library", "brasil"
Data.S "brazil", "rainbow", "obiwan", "kombat", "snowball"
Data.S "marlboro", "snowbal", "playboy", "absolut", "wombat"
Data.S "canced", "icecream", "chance", "celica", "cracker"
Data.S "cancer", "access", "pacific", "chicago", "chocolat"
Data.S "arctic", "clancy", "cactus", "dickhead", "maddock"
Data.S "medical", "claude", "sundance", "dancer", "crawford"
Data.S "richard", "wildcat", "picard", "colorado", "conrad"
Data.S "corrado", "changeme", "chelsea", "peaches", "research"
Data.S "teachers", "teacher", "creative", "cleaner"
Data.S "france", "challeng", "michael", "charlie", "archie"
Data.S "hacker", "chanel", "rachel", "charles", "patches"
Data.S "jackie", "janice", "jessica", "maverick", "metallic"
Data.S "caroline", "special", "claire", "iceman", "maurice"
Data.S "maveric", "veronica", "carrie", "cassie", "active"
Data.S "slacker", "packer", "packers", "marcel", "coltrane"
Data.S "carole", "lacrosse", "scarlet", "scarlett", "castle"
Data.S "carmen", "pacers", "racerx", "stacey", "catfish"
Data.S "californ", "francois", "francis", "falcon", "graphic"
Data.S "logical", "garlic", "camping", "racing", "cougars"
Data.S "cougar", "chiquita", "christia", "nicholas"
Data.S "champion", "cynthia", "charity", "charlott"
Data.S "champs", "caitlin", "victoria", "tricia", "patrick"
Data.S "calvin", "monica", "macintos", "action", "picasso"
Data.S "jackson", "malcolm", "coolman", "classroo", "carlos"
Data.S "crystal", "compaq", "tomcat", "marcus", "cannon"
Data.S "corona", "cyrano", "topcat", "tractor", "laddie"
Data.S "undead", "edward", "maddog", "diamond", "donald"
Data.S "woodland", "greenday", "danielle", "dreamer"
Data.S "reader", "garfield", "alfred", "reading", "gerald"
Data.S "garden", "shithead", "daniel", "ireland", "raider"
Data.S "raiders", "daytek", "leonard", "dreams", "anderson"
Data.S "darren", "sanders", "andrew", "retard", "tuesday"
Data.S "asdfghjk", "asdfgh", "dragonfl", "florida", "friday"
Data.S "asdfjkl", "digital", "godzilla", "douglas", "dragon"
Data.S "harold", "rhonda", "zaphod", "howard", "shadows"
Data.S "shadow", "thursday", "indian", "island", "lindsay"
Data.S "lizard", "madison", "pyramid", "darwin", "tardis"
Data.S "wizard", "majordom", "jordan", "dollars", "orlando"
Data.S "portland", "ronald", "rodman", "raymond", "monday"
Data.S "sunday", "password", "passwd", "jeanette", "sweetpea"
Data.S "jaeger", "general", "eagles", "heather", "kathleen"
Data.S "hawkeye", "elephant", "sheena", "theresa", "theatre"
Data.S "whatever", "whateve", "amelie", "melanie", "elaine"
Data.S "valerie", "jeanne", "yankees", "walleye", "please"
Data.S "seattle", "weasel", "awesome", "netware", "teresa"
Data.S "grateful", "frankie", "fireman", "ferrari", "farmer"
Data.S "safety", "maggie", "georgia", "aggies", "imagine"
Data.S "galileo", "goalie", "enigma", "mirage", "wrangler"
Data.S "angels", "german", "orange", "oranges", "ranger"
Data.S "garnet", "voyager", "garrett", "target", "health"
Data.S "katherin", "sheila", "stephani", "sapphire"
Data.S "asshole", "harley", "stealth", "whales", "ashley"
Data.S "hammer", "herman", "theman", "hamster", "matthew"
Data.S "panther", "hearts", "harvey", "jasmine", "mikael"
Data.S "mailer", "melissa", "valentin", "lorraine", "alpine"
Data.S "aliens", "tequila", "reality", "laurie", "alexis"
Data.S "sammie", "maxime", "marine", "vampire", "insane"
Data.S "painter", "petunia", "praise", "pirate", "sierra"
Data.S "asterix", "xavier", "jasper", "lakers", "walker"
Data.S "kramer", "market", "tanker", "wanker", "parker"
Data.S "startrek", "skater", "maxwell", "stella", "montreal"
Data.S "temporal", "sampler", "marley", "samuel", "napoleon"
Data.S "espanol", "snapple", "planet", "lauren", "stanley"
Data.S "apples", "players", "player", "raquel", "slayer"
Data.S "travel", "walter", "lestat", "superman", "masters"
Data.S "master", "tanner", "suzanne", "newpass", "peanut"
Data.S "warren", "tiffany", "wolfgang", "flamingo", "farming"
Data.S "fugazi", "franklin", "family", "fountain", "wolfman"
Data.S "smashing", "virginia", "sailing", "training"
Data.S "stingray", "giants", "guitar", "magnum", "morgan"
Data.S "mustang", "gymnast", "august", "mishka", "harrison"
Data.S "spanish", "shanti", "joshua", "kathryn", "shalom"
Data.S "hansolo", "phantom", "thomas", "shannon", "hanson"
Data.S "anthony", "sharon", "hatton", "author", "arthur"
Data.S "nikita", "williams", "william", "raistlin", "olivia"
Data.S "julian", "jasmin", "allison", "marilyn", "alison"
Data.S "polaris", "sailor", "quality", "sylvia", "ironman"
Data.S "mountain", "tinman", "marino", "martin", "marvin"
Data.S "matrix", "nissan", "passion", "station", "tristan"
Data.S "austin", "utopia", "warriors", "warrior", "artist"
Data.S "travis", "krystal", "spanky", "sparky", "apollo"
Data.S "salmon", "psalms", "larson", "royals", "taylor"
Data.S "norman", "snowman", "sampson", "samson", "mozart"
Data.S "watson", "saturn", "tattoo", "toyota", "sparrow"
Data.S "parrot", "passwor", "qwaszx", "stuart", "taurus"
Data.S "bubbles", "debbie", "bluebird", "bigbird", "pebbles"
Data.S "robbie", "hobbit", "jimbob", "booboo", "december"
Data.S "quebec", "robotech", "republic", "october", "public"
Data.S "zxcvbnm", "broncos", "cowboys", "scooby", "cowboy"
Data.S "firebird", "bigred", "bridges", "dogbert", "thunderb"
Data.S "birdie", "blondie", "dilbert", "doobie", "blonde"
Data.S "rosebud", "bigdog", "bulldog", "sunbird", "remember"
Data.S "septembe", "homebrew", "herbert", "biteme", "bernie"
Data.S "reebok", "rebels", "byteme", "brewster", "webster"
Data.S "boogie", "junebug", "goblue", "goober", "shelby"
Data.S "theboss", "kimberly", "zombie", "timber", "bonnie"
Data.S "benoit", "business", "nesbitt", "bootsie", "bluesky"
Data.S "brooke", "volleyb", "bullet", "blowme", "trouble"
Data.S "butler", "boomer", "benson", "booster", "trebor"
Data.S "buster", "bigfoot", "blowfish", "bright", "bowling"
Data.S "biology", "gibson", "bullshit", "robinhoo", "bookit"
Data.S "wilbur", "bonjour", "symbol", "boston", "browns"
Data.S "buttons", "button", "brutus", "cccccc", "electric"
Data.S "science", "chicken", "cricket", "celtics", "cyclone"
Data.S "connect", "concept", "soccer", "success", "church"
Data.S "chucky", "scotch", "cloclo", "cuddles", "depeche"
Data.S "mercedes", "frederic", "deutsch", "duckie", "wicked"
Data.S "cinder", "director", "orchid", "dominic", "doctor"
Data.S "cheese", "coffee", "fletcher", "gretchen", "college"
Data.S "michelle", "michele", "speech", "chester", "celine"
Data.S "eclipse", "pierce", "service", "colleen", "telecom"
Data.S "welcome", "spencer", "center", "except", "secret"
Data.S "chiefs", "fletch", "fuckme", "fucker", "michell"
Data.S "mitchell", "michel", "chipper", "hockey", "cheryl"
Data.S "techno", "porsche", "hector", "cherry", "justice"
Data.S "pickle", "mickey", "snicker", "snickers", "cookie"
Data.S "cookies", "nicole", "police", "clipper", "mexico"
Data.S "connie", "vincent", "prince", "princess", "picture"
Data.S "pisces", "security", "cruise", "rocket", "puckett"
Data.S "tucker", "clover", "computer", "compute", "mercury"
Data.S "newcourt", "courtney", "cooper", "scooter", "coyote"
Data.S "copper", "fuckoff", "scruffy", "fiction", "fuckyou"
Data.S "gocougs", "christin", "christop", "chrissy"
Data.S "christ", "christy", "school", "psycho", "politics"
Data.S "knicks", "lincoln", "unicorn", "scorpion", "corwin"
Data.S "sonics", "scorpio", "victor", "victory", "curtis"
Data.S "trucks", "control", "compton", "moocow", "cosmos"
Data.S "popcorn", "xcountry", "country", "scotty", "deedee"
Data.S "dundee", "freddy", "dodger", "dodgers", "defense"
Data.S "freedom", "fender", "legend", "deliver", "denise"
Data.S "kennedy", "ledzep", "denver", "speedo", "speedy"
Data.S "dexter", "friend", "friends", "doggie", "digger"
Data.S "goldie", "redwing", "design", "doogie", "dougie"
Data.S "golden", "hendrix", "thunder", "inside", "kinder"
Data.S "redskin", "dookie", "lindsey", "dennis", "trident"
Data.S "sendit", "sidney", "detroit", "spider", "strider"
Data.S "donkey", "reynolds", "elwood", "redrum", "wonder"
Data.S "notused", "student", "sydney", "windsurf", "oxford"
Data.S "midnight", "dwight", "hotdog", "indigo", "kingdom"
Data.S "snoopdog", "gordon", "phurivdli", "judith", "dolphin"
Data.S "dolphins", "hotrod", "dorothy", "midori", "skidoo"
Data.S "domino", "nimrod", "wisdom", "windows", "dustin"
Data.S "stupid", "drizzt", "london", "studly", "voodoo"
Data.S "peewee", "reefer", "eugene", "sweetie", "kleenex"
Data.S "skeeter", "penelope", "steelers", "steele", "eeyore"
Data.S "weezer", "jeffrey", "jennifer", "jenifer", "ferret"
Data.S "reggie", "george", "wheeling", "genesis", "sergei"
Data.S "energy", "hershey", "kenneth", "shelley", "helpme"
Data.S "wheels", "promethe", "hermes", "stephen", "einstein"
Data.S "jessie", "nellie", "leslie", "letmein", "zeppelin"
Data.S "etoile", "nemesis", "internet", "pierre", "jewels"
Data.S "jeremy", "jensen", "jester", "kelsey", "loveme"
Data.S "people", "explorer", "wrestle", "letter", "wesley"
Data.S "velvet", "western", "newuser", "steven", "popeye"
Data.S "europe", "pepper", "express", "tester", "stever"
Data.S "testtest", "sweets", "sweety", "tweety", "griffey"
Data.S "golfer", "fisher", "spitfire", "flipper", "xfiles"
Data.S "fozzie", "sunflowe", "flowers", "flower", "flyers"
Data.S "forest", "surfer", "future", "ginger", "tigger"
Data.S "google", "nugget", "gregory", "theking", "gopher"
Data.S "gemini", "gilles", "piglet", "penguin", "guinness"
Data.S "singer", "testing", "genius", "tigers", "gretzky"
Data.S "gunner", "nguyen", "grover", "shirley", "memphis"
Data.S "sunshine", "phoenix", "whitney", "zenith", "hootie"
Data.S "sophie", "joseph", "huskers", "shelly", "mother"
Data.S "thumper", "hornets", "hornet", "hunter", "shooter"
Data.S "topher", "horses", "zephyr", "sherry", "millie"
Data.S "willie", "olivier", "minnie", "winnie", "trixie"
Data.S "jupiter", "killme", "killer", "mookie", "kermit"
Data.S "kristen", "tinker", "kittens", "kitten", "pookie"
Data.S "skipper", "miller", "soleil", "elliot", "little"
Data.S "merlin", "simple", "smiles", "smiley", "online"
Data.S "wolverin", "liverpoo", "iloveyou", "oliver"
Data.S "louise", "violet", "silver", "sylvie", "mortimer"
Data.S "swimmer", "emmitt", "monique", "pentium", "mittens"
Data.S "niners", "intern", "winner", "tennis", "senior"
Data.S "sniper", "sunrise", "winter", "tootsie", "puppies"
Data.S "ripper", "sprite", "monkey", "smokey", "network"
Data.S "newyork", "volley", "yellow", "russell", "lennon"
Data.S "nelson", "looney", "loveyou", "protel", "wolves"
Data.S "purple", "russel", "turtle", "memory", "summer"
Data.S "monster", "vermont", "trumpet", "system", "newton"
Data.S "yvonne", "runner", "preston", "entropy", "reznor"
Data.S "sunset", "rooster", "property", "porter", "export"
Data.S "trevor", "qwerty", "fluffy", "muffin", "snuffy"
Data.S "golfing", "froggy", "kingfish", "fishing", "flight"
Data.S "gofish", "goforit", "informix", "pinkfloy", "foxtrot"
Data.S "frosty", "zhongguo", "knights", "knight", "nothing"
Data.S "hunting", "wright", "shotgun", "lionking", "skiing"
Data.S "vikings", "viking", "swimming", "running", "roping"
Data.S "spring", "grumpy", "topgun", "groovy", "phillip"
Data.S "philip", "whisky", "timothy", "smiths", "sunshin"
Data.S "horizon", "history", "johnson", "johnny", "murphy"
Data.S "houston", "python", "shorty", "kristin", "kristi"
Data.S "million", "mission", "tintin", "vision", "spirit"
Data.S "junior", "justin", "pumpkin", "punkin", "skinny"
Data.S "stinky", "skippy", "kristy", "suzuki", "willow"
Data.S "wilson", "moroni", "mirror", "morris", "stimpy"
Data.S "winston", "poiuyt", "squirt", "spunky", "spooky"
Data.S "monopoly", "molson", "moomoo", "stormy", "toronto"
Data.S "snoopy", "support", "sports"
EndDataSection
#WordCount = 1275
Structure WORDATTR
Coef.L
Root.L
EndStructure
Structure COEF
Begin.L
End.L
EndStructure
Define LastWord.L
Define i.L
Define j.L
Define k.L
Define m.L
Define Tmp.S
Define TestSt.S
Define A.L
Define FirstCoef.L
Define LastCoef.L
Define LI.L
Define LS.L
Define St.S
Define Word.S
Define LWord.L
Define Paste.S
OpenWindow(0, 0, 0, 320, 0, "Initialisation...", $CF0001)
StickyWindow(0, 1)
LastWord = #WordCount - 1
Global Dim WordList.S(LastWord)
Global NewList WordAttr.WORDATTR()
;- On sort la liste de la DataSection
For i = 0 To LastWord
Read.S WordList(i)
WordList(i) = LCase(WordList(i) )
AddElement(WordAttr() )
WordAttr()\Root = i
;-> Un coef par mot
For j = 1 To Len(WordList(i) )
A = Asc(Mid(WordList(i), j, 1) )
WordAttr()\Coef + A
Next j
Next i
;- On fait un tri par coef
SortStructuredList(WordAttr(), #PB_Sort_Ascending, OffsetOf(WORDATTR\Coef), #PB_Sort_Long)
;- On réfère les coefs au premier de la liste...
SelectElement(WordAttr(), 0)
FirstCoef = WordAttr()\Coef
ForEach WordAttr()
WordAttr()\Coef - FirstCoef
Next
;- ...Pour la table d'accès par composition
LastCoef = WordAttr()\Coef
Global Dim Coef.COEF(LastCoef)
;(Mise à zéro)
For i = 0 To LastCoef
Coef(i)\Begin = -1
Coef(i)\End = -1
Next i
; Modif de Fred ! >> CountList devient ListSize...
LS = ListSize(WordAttr() )
ForEach WordAttr()
LI = ListIndex(WordAttr() )
A = WordAttr()\Coef
Coef(A)\Begin = LI
If LI + 1 < LS
For i = LI + 1 To LS
SelectElement(WordAttr(), i)
If WordAttr()\Coef <> A
Coef(A)\End = i - 1
SelectElement(WordAttr(), i - 1)
Break
EndIf
Next i
Else
Coef(A)\End = LS - 1
EndIf
Next
CloseWindow(0)
;- On vide le presse-papier
SetClipboardText("")
;- On attend que le presse-papier contienne qqch...
Repeat
Delay(5)
St = GetClipboardText()
Until St <> ""
;- On traite...
OpenWindow(0, 0, 0, 320, 0, "Traitement...", $CF0001)
StickyWindow(0, 1)
Paste = ""
For i = 0 To 9
Word = LCase(Trim(StringField(St, i << 1 + 1, Chr(13) + Chr(10) ) ) )
If Asc(Left(Word, 1) ) = 10
Word = Right(Word, Len(Word) - 1)
EndIf
LWord = Len(Word)
Coef = 0
For j = 1 To Len(Word)
A = Asc(Mid(Word, j, 1) )
Coef + A
Next j
Coef - FirstCoef
If Coef(Coef)\Begin = Coef(Coef)\End
SelectElement(WordAttr(), Coef(Coef)\Begin)
Paste + WordList(WordAttr()\Root) + ", "
Else
For j = Coef(Coef)\Begin To Coef(Coef)\End
SelectElement(WordAttr(), j)
TestSt = WordList(WordAttr()\Root)
Tmp = TestSt
If Len(TestSt) = LWord
For k = 1 To LWord
For m = 1 To Len(Tmp)
If Mid(Word, k, 1) = Mid(Tmp, m, 1)
Tmp = Left(Tmp, m - 1) + Right(Tmp, Len(Tmp) - m)
EndIf
Next m
Next k
If Tmp = ""
Paste + TestSt + ", "
Break
EndIf
EndIf
Next j
EndIf
Next i
;- Et on renvoie dans le presse-papier
SetClipboardText(Paste)
CloseWindow(0)