Scrabble algorithm

    Date: 12/15/05 (Web Development)    Keywords: no keywords

    Can someone help me out with an algorithm for validating playing input in a scrabble game?
    Basically two structures are being used for data at that point: the Board, which holds info about what's in every tile, and a letterBuffer, which is a vector of only those letters that the player used in the turn.

    First (and only) thing I'm doing right now is checking whether everything the player used in the turn is on the same line. I just go through the letterBuffer vector and make sure that it either has all the same X coordinates or all the same Y coordinates.

    What I still need:
    1) make sure that there are no white spaces between the letters used in the turn. There can be letters from previous turns between them, but skipping white space is not permitted.
    2) every letter placed on the board that has another letter adjacent to it must make a word on that line.
    3) collect all the words made in this turn
    4) verify that the words are valid words

    2 & 3 & 4 are related in the sense that i could collect all letter combinations made in the turn, and then verify them against a dictionary. so 2 & 3 could be replaced by "collect all letter combinations made in the turn". which.. is problematic.

    so, any suggestions?

    Source: http://www.livejournal.com/community/webdev/279341.html

« the web hosting question... || Arrays and functions? »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home