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

Safe HaskellSafe
LanguageHaskell98

Wordify.Rules.Tile

Synopsis

Documentation

data Tile Source #

A 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'.

Constructors

Letter Char Int 
Blank (Maybe Char) 

Instances

Eq Tile Source # 

Methods

(==) :: Tile -> Tile -> Bool #

(/=) :: Tile -> Tile -> Bool #

Ord Tile Source # 

Methods

compare :: Tile -> Tile -> Ordering #

(<) :: Tile -> Tile -> Bool #

(<=) :: Tile -> Tile -> Bool #

(>) :: Tile -> Tile -> Bool #

(>=) :: Tile -> Tile -> Bool #

max :: Tile -> Tile -> Tile #

min :: Tile -> Tile -> Tile #

Show Tile Source # 

Methods

showsPrec :: Int -> Tile -> ShowS #

show :: Tile -> String #

showList :: [Tile] -> ShowS #

isPlayable :: Tile -> Tile -> Bool Source #

isPlayble, 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 letter

printLetter :: Tile -> Maybe Char Source #

Prints a letter in the style found on a scoresheet. E.g. blank letters are printed in lowercase.