Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- data FormedWords
- type FormedWord = Seq (Pos, Square)
- wordsFormedMidGame :: Board -> Map Pos Tile -> Either ScrabbleError FormedWords
- wordFormedFirstMove :: Board -> Map Pos Tile -> Either ScrabbleError FormedWords
- wordStrings :: FormedWords -> [String]
- wordsWithScores :: FormedWords -> (Int, [(String, Int)])
- mainWord :: FormedWords -> FormedWord
- adjacentWords :: FormedWords -> [FormedWord]
- playerPlaced :: FormedWords -> [(Pos, Square)]
- bingoBonusApplied :: FormedWords -> Bool
Documentation
type FormedWord = Seq (Pos, Square) Source
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.