!      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  Safe Safe ;Safe Safe wordify4The position above the given position, if it exists. wordify4The position below the given position, if it exists.wordify=The position to the left of the given position, if it exists.wordify>The position to the right of the given position, if it exists.wordifyThe position of the star square   Safe4wordifywA tile is a letter with a value, or a Blank tile which may have been given a letter. Blank tiles always have the value '0'.wordify`Prints a letter in the style found on a scoresheet. E.g. blank letters are printed in lowercase.wordifyisPlayble, applied to a played tile and compared against a tile returns true if a player returned a letter tile on their rack, or if the player played a Blank that has been given a letterSafe'wordify(Calculates the score of one played word.hThe first list contains squares that are already on the board (and thus are not subject to bonuses).9The second list contains squares that are newly occupied.wordifyThe bonus operations that should be applied to the score of a word once it has been calculated. When using to calculate score, double and triple word bonuses should be applied last.wordify'Base value of a square, without bonuses !"#$%&'()* !"#$%*'(&)Safeb././Safe& AwordifyRemoves played tiles from the player's tile rack, if it was possible for the player to play those tiles in the first place. A player may play a tile on his rack, unless it is a blank, which must first be assigned a letter.wordifyReturns true if the player cannot place any of the given tiles. A player cannot play a Blank tile that they have not given a letter, or a tile not on their rack.145326789:;<=>?@AB167238549:;<?A@=>BSafe;HwordifyYThe caller has supplied an invalid path to a letter bag file, or the file is not openableIwordify9The letter bag file is marformed, so could not be parsed.Jwordify0The path given to a dictionary file was invalid.Kwordify<The dictionary file could not be parsed as it was malformed.Lwordify?A letter bag with insufficient tiles was used to create a game.MwordifyVThe player has made an illegal tile placement. Tiles placed must form a line of tiles.NwordifydThe tiles the player placed do not connect with any word (applies after the first move on the board)OwordifyHThe client put the player in the situation to be able to place no tiles.Pwordify4The first move on the board does not cover the star.Qwordify]The client allowed the player to place tiles on a square that is already occupied with tiles.Rwordify?A blank tile must be labeled with a letter before being placed.SwordifyUThe tiles the player placed formed one or more words which are not in the dictionary.TwordifyWThe caller allowed the client to place tiles on the board which were not in their rack.UwordifyZThe caller allowed the player to attempt to exchange when no letters were left in the bag.VwordifyQThe caller allowed the player to attempt to exchange tiles that they do not have.Wwordify?The caller allowed a move to be made when the game is finished.GHIKJLMNOPQRSTWUVXGHIKJLMNOPQRSTWUVX Safe@@\wordifykReturns the list of words which are not present in the given dictionary from a list of input words. _wordifyjCreates a dictionary from a file containing a list of valid words, each word being seperated by a newline.[\]^_[_^]\ Safe@abefdcabcdfe Noneh iwordifyCreates a letter bag from a file where each line contains a space delimited letter character, letter value, and letter distribution. A blank letter is represented by a '_'/ character and has a disribution, but no value.@If successful, the letter bag is shuffled before it is returned.jwordifyjCreates a letter bag from a list of tiles. The order of the tiles is retained in the resulting letter bag.This function is effectful as it is necessary to create a stdGen for list to allow it to be shuffled using this generator in the future.wordifyHelper function to construct a LetterBag. Maps the valid letters in a letter bag to the tile representing that letter on the board.kwordifyTakes n% numbers from a letter bag, yielding 5 if there is not enough tiles left in the bag or a W tuple where the left value is the taken tiles, and the right value is the new bag.lwordifyExchanges given tiles for the same number of tiles from the bag. The exchanged letters are added to the bag, the bag is then shuffled, and then the same number of tiles as exchanged are drawn from the bag.Returns a if there are not enough letters in the bag to exchange the given tiles for. Otherwise returns < with a tuple with the tiles given, and the new letterbag.mwordifyShuffles the contents of a letter bag. The bag is shuffled using the random generator which was created while constructing the bag. This function should not be used when creating an additional game with a new letter bag as the same seed value will be shared across games (meaning tiles will come out of the bag in the same order.) When constructing an additional game, use shuffleWithNewGenerator.nwordify)Creates a letter bag using a list of tiles, and a generator which should be used when shuffling the bag. This function allows a game to be stepped through from the beginning where the moves and original generator were recorded, with any shuffling yielding the same bag as in the original game.owordify5Get the letter bag's current generator, which will be used to shuffle the contents of the bag in the next exchange or shuffle. If taken at the start of the game, with the original list of tiles in the bag in order, the game moves may be replayed in order with the original results of any shuffle retained.pwordifyShuffles a letter bag using a new random generator. This function should be used when spawning a new game using a letter bag with all the tiles remaining so that letter bags are unique between game instances. adcfijklmnop aficjnklmpdo Safey4 qwordifyAReturns all the squares on the board, ordered by column then row.rwordifyhPlaces a tile on a square and yields the new board, if the target square is empty. Otherwise yields .swordifybReturns the square at a given position if it is not occupied by a tile. Otherwise returns Nothing.twordify^Returns the square at a given position if it is occupied by a tile. Otherwise returns Nothing.uwordifyIAll letters immediately above a given square until a non-occupied square vwordifyIAll letters immediately below a given square until a non-occupied square wwordifyKAll letters immediately left of a given square until a non-occupied square xwordifyLAll letters immediately right of a given square until a non-occupied square ywordifyFinds the empty square positions horizontally or vertically from a given position, skipping any squares that are occupied by a tilezwordifyZPretty prints a board to a human readable string representation. Helpful for development. {wordifyCreates an empty board. .qrstuvwxyz{ .{qrtyuvwxsz Noney}~}~NonewordifyStarts a new game. A game has at least 2 players, and 2 optional players (player 3 and 4.) The players should be newly created, as tiles from the letter bag will be distributed to each player.RTakes a letter bag and dictionary, which should be localised to the same language.KYields a tuple with the first player and the initial game state. Returns a R if there are not enough tiles in the letter bag to distribute to the players.wordify0Returns a history of the moves made in the game.}}Safe wordifyPretty prints the places a given formed word intersects with letters that were already on the board using brackets. E.g. T(HI)S would denote that the player placed a T and an S4 on to the board, using the already placed word HI to form the new word THIS.wordifyScores an individual word. iNote: overallscore should be used to obtain the overall score as it takes into account any bingo bonuses.wordify)Calculates the overall score of the play.bIf a player managed to place all 7 of their letters, then they receive a bingo bonus of 50 points.wordifyAll the words formed by a play.wordifyReturns 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.wordifyReturns 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.wordify~Returns the main word formed by the played tiles. The main word is the linear stretch of tiles formed by the tiles placed.wordifyGReturns the list of words which were adjacent to the main word formed. wordifyZReturns the list of positions mapped to the squares that the player placed their tiles on.wordifyScores 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.wordifyqReturns true if the player placed all 7 of their letters while forming these words, incurring a + 50 score bonus.wordify0Returns the words formed by the play as strings.NoneAwordifykThe new player (with their updated letter rack and score), new game state, and the words formed by the movewordify^The new game state, and the player with their rack before and after the exchange respectively.wordifyMThe new game state with the opportunity to play passed on to the next player.wordifyThe game has finished. The final game state, and the final words formed (if the game was ended by a player placing their final tiles.) The players before their scores were increased or decreased is also given.wordify7Transitiions the game to the next state. If the move places tiles, the player must have the tiles to place and place the tiles legally. If the move exchanges tiles, the bag must not be empty and the player must have the tiles to exchange. A ScrabbleError is returned if these condtions are not the case.wordifyRestores a game from a list of moves. The game must be set up in the way the original game was set up (including the letter bag constructed with the same tiles and random generator, dictionary and the list of players in the original order.)#If the game is not set up as it was originally, this function will return a scrabble error with the move which was invalid with the given state. For example, if the original players are not ordered in the correct way then the player will not have the required tiles to make the move.wordify_Maps each move to a resulting game transition, if the move is legal. Has the same semantics as  but returns a list of  so that laziness can be maintained, meaning all the game transitions dont have to be buffered before they can be consumed.  !"#$%&'()*+,-./0123456789:;<=>??@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij k l m n o p q q r s t u v w x y z { | } ~              &wordify-0.1.0.0-K0tTpbiZVruIN66xqQpHvqLibWordify.Rules.Pos.InternalWordify.Rules.PosWordify.Rules.TileWordify.Rules.SquareWordify.Rules.Board.InternalWordify.Rules.PlayerWordify.Rules.ScrabbleErrorWordify.Rules.Dictionary Wordify.Rules.LetterBag.InternalWordify.Rules.LetterBagWordify.Rules.BoardWordify.Rules.Game.InternalWordify.Rules.GameWordify.Rules.FormedWordWordify.Rules.Move Paths_wordifysomeFuncPos$fEqPos $fShowPos$fOrdPos Direction HorizontalVerticalposMinposMaxposAtabovebelowleftrightstarPos directionxPosyPos gridValue $fEqDirectionTileLetterBlank tileValue tileLetter printLetter isPlayable $fShowTile$fEqTile $fOrdTileSquareNormal DoubleLetter TripleLetter DoubleWord TripleWord putTileOn scoreSquaressquareIfOccupiedtileIfOccupied isOccupied $fShowSquare $fEqSquare $fOrdSquareBoard $fEqBoardPlayernamerackscoreendBonus LetterRack makePlayer tilesOnRack increaseScore reduceScoregiveEndLosePenaltygiveEndWinBonus hasEmptyRack tileValues giveTiles removeTilesremovePlayedTilesexchange$fShowLetterRack$fEqLetterRack $fShowPlayer $fEqPlayer ScrabbleErrorLetterBagFileNotOpenableMalformedLetterBagFileDictionaryFileNotFoundMalformedDictionaryFileNotEnoughLettersInStartingBagMisplacedLetterDoesNotConnectWithWord NoTilesPlacedDoesNotCoverTheStarTilePlacedTileOnOccupiedSquareCannotPlaceBlankWithoutLetterWordsNotInDictionaryPlayerCannotPlace CannotExchangeWhenNoLettersInBagPlayerCannotExchangeGameNotInProgress MiscError$fShowScrabbleError$fEqScrabbleError Dictionary invalidWords isValidWorddictionaryFromWordsmakeDictionary$fShowDictionary LetterBagtilesbagSize generator validLetters $fEqLetterBag$fShowLetterBagmakeBag bagFromTiles takeLettersexchangeLetters shuffleBagmakeBagUsingGenerator getGeneratorshuffleWithNewGenerator allSquares placeTileunoccupiedSquareAtoccupiedSquareAt lettersAbove lettersBelow lettersLeft lettersRightemptySquaresFrom prettyPrint emptyBoard $fShowBoardGameplayer1player2optionalPlayersboardbag dictionary currentPlayer playerNumber moveNumberpasses gameStatushistory GameStatus InProgressFinishedHistoryMove PlaceTilesExchangePass updateGame nextPlayerpass updateHistory$fEqMove $fShowMove $fEqHistory $fShowHistory$fEqGameStatus$fShowGameStatusmakeGameplayers getPlayernumberOfPlayers movesMade PlacedSquares FormedWord FormedWordsprettyPrintIntersections scoreWord overallScoreallWordswordFormedFirstMovewordsFormedMidGamemainWord adjacentWords playerPlacedplayerPlacedMapwordsWithScoresbingoBonusApplied wordStrings makeString$fShowFormedWords$fEqFormedWordsGameTransitionMoveTransitionExchangeTransitionPassTransition GameFinishedmakeMove restoreGamerestoreGameLazynewGameversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNameapplyWordBonus baseValueplayerCanPlace bagLettersbase GHC.MaybeNothingJust Data.EitherLeftEither