Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrabble Word Placement C#

I'm currently writing a scrabble-like game in C#. I can get the computer to find the highest point value word that can be made using the current rack, however I have no idea how to check if that word is "Placeable" on the 15*15 Gameboard(2D Array: string[,]).

In it's default state(with no Letters on the board) all elements are set to 0.

Is allowed

---------------
-------H-------
-------E-------
-----FILL------
-------L-------
-------O-------
---------------

How can I check if the word is not For example:

Is Not Allowed

 ---------------
 -H-------------
 -E-------------
FILL------------ <-- F is out of bounds
 -L-------------
 -O-------------
 ---------------

Is Not Allowed

 ---------------
 -H-------------
 -E-W-----------
 -L-O-----------
 -L-R-----------
 FOLL----------- <-- Fill is overlapping with O
 ---D-----------
like image 960
Tony Wu Avatar asked Jul 21 '11 12:07

Tony Wu


People also ask

How much is c worth in Scrabble?

Tile Values 1 Point - A, E, I, L, N, O, R, S, T and U. 2 Points - D and G. 3 Points - B, C, M and P. 4 Points - F, H, V, W and Y.


1 Answers

The paper, "The worlds fastest Scrabble engine" (PDF), is from 1988 and describes an efficient Scrabble engine. It's short and surprisingly readable!

like image 85
Jeff Foster Avatar answered Oct 05 '22 22:10

Jeff Foster