Created
September 22, 2017 16:50
-
-
Save Lifelovinglight/2c53fee9df1a6688a5f6f7256fe5291d to your computer and use it in GitHub Desktop.
how2adventure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Verb = Look | |
| Take | |
| Drop | |
| Put | |
deriving (Enum, Show, Eq) | |
data Thing = Player | |
| Lantern | |
| Sword | |
| Bag | |
deriving (Enum, Show, Eq) | |
data Action = Verb (Maybe Thing) (Maybe Thing) | |
-- Parser state is list of visible/reachable things that can be resolved | |
data AdventureParser a = Parsec String [Things] a | |
parseCommand :: AdventureParser Action | |
parseCommand = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment