http://qs1969.pair.com?node_id=11136493


in reply to Re^3: Problem with regex wildcard operator (.)...?
in thread Problem with regex wildcard operator (.)...?

I am still not "getting it" in terms of your input syntax and how it should match against the dictionary.

I recently wrote a "cheater program" for a less sophisticated game, but perhaps with some similar matching requirements?

In my game, I have a set of "tiles", letters than I can use to form words. I cannot use any letter other than one of these letters to form words. There are not any 2 letter words in my dictionary. Your dictionary has a lot of weird words, but I guess that is how scrabble is!

Your example is a bit hard for me to figure out since, es,os,sh,si are not "normal English words" although as,is,so are. Likewise "aa" is not a normal English word, although "as" is. There are words in the scrabble dictionary that I've never read, heard or used.

What I'd like to see is a user session that shows how your scrabble cheat game works. I will attach a user example from my cheat program for another game. Once we understand what the code is supposed to do, then at least I would be interested in helping you create a "blackbelt" level cheat program - just for the fun of it!

Here is an example of the kind of example that I want from you:

Example 1: leading ";" means this is a list of letters instead of a pattern list of letters or pattern: ;lolewf list of letters or pattern: --- The --- says: show me all 3 letter words that can be formed from my letter "universe". elf ell few foe fol low owe owl woe # Example 2: # Show me all 4 letter words which can be formed from # the "list of letters" that have "l" as the 3rd letter list of letters or pattern: ;odlswe # List of Letters list of letters or pattern: --l- # A search pattern dole owls sold sole weld wold
I don't know really anything about Scrabble. But I think you will have to develop a syntax to input words that are on the board already. I think if some guy plays "pagan", you can play "ize" to turn this into "paganize" and score big points. In addition, each letter has some kind of "value", playing a "z" is worth more than playing an "a". I suspect that you are going to want a word sort order that instead of being alphabetical, is based upon the point value of the word?

I think your tr statement could be better:
tr is a very stupid thing and it does not use character sets. I am not sure why your code seems to work.

use strict; use warnings; my $string = '\abCD'; $string =~ tr/\[A-Z]/[a-z]/; #should be tr/A-Z/a-z/? print "$string\n";