Hangkell-1.0.0: Like Hangman but online!

Copyright>implying
License>implying
MaintainerFlorian Hageneder
Stabilitynone
Portabilitywhat?
Safe HaskellNone
LanguageHaskell2010

Game

Description

 

Synopsis

Documentation

data Game Source #

The type to store a game sessions state

Constructors

Game 

Fields

Instances

Eq Game Source # 

Methods

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

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

Read Game Source # 
Show Game Source # 

Methods

showsPrec :: Int -> Game -> ShowS #

show :: Game -> String #

showList :: [Game] -> ShowS #

ToJSON Game Source # 

Methods

toJSON :: Game -> Value

toEncoding :: Game -> Encoding

toJSONList :: [Game] -> Value

toEncodingList :: [Game] -> Encoding

newGame Source #

Arguments

:: Int

The ID of this session

-> String

The goal of this instance of Hangman

-> Maybe Game

A valid new game or Nothing

Creates a new game session with an completely unsolved given solutionWord

makeATurn Source #

Arguments

:: Player

The player who wants to make a turn

-> Char

The char to try

-> Game

The game to operate on

-> (Game, Bool)

The updated game

Updates the given game session and transists it to the next state

makeASolve Source #

Arguments

:: Player

The player who wants to solve the game

-> String

The solution to try

-> Game

The game to operate on

-> (Game, Bool)

The updated game

Updates the given game session and transists it to the next state

nextPlayerAlive :: Game -> Player Source #

returns the next alive player that is at turn.