home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!bx955
- From: bx955@cleveland.Freenet.Edu (Michael Todd Glazier)
- Subject: Using Awk in a Scrabble(c) Utility.
- Message-ID: <1992Aug15.212252.28452@usenet.ins.cwru.edu>
- Sender: news@usenet.ins.cwru.edu
- Nntp-Posting-Host: slc8.ins.cwru.edu
- Reply-To: bx955@cleveland.Freenet.Edu (Michael Todd Glazier)
- Organization: Case Western Reserve University, Cleveland, OH (USA)
- Date: Sat, 15 Aug 92 21:22:52 GMT
- Lines: 32
-
-
- I'm a novice Unix dude trying to write a tiny (and very messy)
- Unix util that takes a list of letters as the parameter and
- makes as many words out of those letters as it can, !BUT!, with
- out using any letters twice, unless they are specified in the
- list of letters.
-
- Here's what I've done, or perhaps I should say, learned to do, so far.
-
-
- $ cat sc
- cat /usr/dict/web2 | egrep '^['$1']['$1']?['$1']? etc (repeated for as many
- squares across a scrabble board is.)
-
- What I get is close to what I need. It does give me all the words that
- that $1 makes up, but it uses any letters it feels like more than once.
-
- What I'd like to do is make second filter, I think it'll have to be awk,
- that'll check the words against the letters input, and keep the words that
- supposed to duplicate letters, get the rid of the one that shouldn't have
- duplicate letters, and pass that on to STDOUT.
-
- Or am I just in over my head?
-
- BTW, I'm using NeXT Unix, which seems to me be pickier than most other flavors
- of Unix.
-
- Michael Todd
- bx955@cleveland.freenet.edu
- --
-
-