I have been playing a variety of games like Scrabble and wanted to work up a perl utility to tilt the game in my favor.

Always a fun challenge.

are you aware of any existing solutions to this

Games::Literati, originally by Chicheng Zhang (and now maintained by me), implements the rules for Scrabble (or Super Scrabble), Literati (the early-2000's yahoo-games clone), and Words With Friends. You can also implement custom boards, though my TODO on documenting that one has never been finished -- but if you study how the individual games are done, you should be able to figure out how to define your own gameboard function. For playing, you just have to supply a valid text dictionary file (one word per line), in whatever language you want. It originally started with Scrabble and Literati; when I took it over, I added Super Scrabble and Words With Friends (and fixed a couple scoring bugs). If you come up with a better algorithm for implementing the search than Chicheng Zhang did, and wanted to make a pull request, feel free (likely to be merged, as long as it passes all the coverage tests and doesn't change the user-interface, thus messing up my WWF-games-in-progress).

update: link fixed. Thanks Discipulus and Corion


In reply to Re: using perl to find words for scrabble by pryrt
in thread using perl to find words for scrabble by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.