There's Games::Literati already in CPAN which does all the math work (scoring words, and finding optimum scores, which would be great for a computer opponent). I recently took over maintenance of the module -- it originally had Scrabble and Literati (the old Yahoo! Games board from the early 2000's), and I added in Words With Friends, and Super-Scrabble, and hopefully making it easier to extend.

When I found the right Round TuitTM, I was going to eventually expand it to have alternate interfaces of a GUI and a web interface -- either as sub-modules, or over in the App hierarchy. (Something like App::Games::Literati::Web, ...::WinGui, ...::TkGui). But I wouldn't complain if you wanted to help / work on the front ends; in fact, it would be good to work together to keep them in sync.

If you do want to go that direction, play around with the existing single-turn command-line interface from the existing module, and then we can talk about what features I need to add to the backend to make it easier to program the interface. I know one quick fix would be for the game initializer routines to define the letter frequencies, not just the letter scores and board scores. There's probably also a few functions that need to be taken out into their own sub instead of being buried in the find-best-scores loop, soas to make it easier for the interface.


In reply to Re: How to build a scrabble type of game with perl by pryrt
in thread How to build a scrabble type of game with perl by Demeter

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.