haskellscrabble-0.1.0.0: A scrabble library capturing the core game logic of scrabble.

Safe HaskellSafe-Inferred
LanguageHaskell98

Wordify.Rules.FormedWord

Synopsis

Documentation

wordsFormedMidGame :: Board -> Map Pos Tile -> Either ScrabbleError FormedWords Source

Returns the words formed by the tiles played on the board. A played word must be connected to a tile already on the board (or intersect tiles on the board), and be formed linearly. Any blank tiles must be labeled.

wordFormedFirstMove :: Board -> Map Pos Tile -> Either ScrabbleError FormedWords Source

Returns the word formed by the first move on the board. The word must cover the star tile, and be linear. Any blank tiles must be labeled.

wordStrings :: FormedWords -> [String] Source

Returns the words formed by the play as strings.

wordsWithScores :: FormedWords -> (Int, [(String, Int)]) Source

Scores the words formed by the tiles placed. The first item in the tuple is the overall score, while the second item is the list of scores for all the words formed.

mainWord :: FormedWords -> FormedWord Source

Returns the main word formed by the played tiles. The main word is the linear stretch of tiles formed by the tiles placed.

adjacentWords :: FormedWords -> [FormedWord] Source

Returns the list of words which were adjacent to the main word formed.

playerPlaced :: FormedWords -> [(Pos, Square)] Source

Returns the list of positions mapped to the squares that the player placed their tiles on.

bingoBonusApplied :: FormedWords -> Bool Source

Returns true if the player placed all 7 of their letters while forming these words, incurring a + 50 score bonus.