https://github.com/lovasko/hs-halite
Halite AI Challenge Haskell Base
https://github.com/lovasko/hs-halite
client halite haskell
Last synced: 4 months ago
JSON representation
Halite AI Challenge Haskell Base
- Host: GitHub
- URL: https://github.com/lovasko/hs-halite
- Owner: lovasko
- License: bsd-2-clause
- Created: 2017-02-07T22:58:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-07T23:43:51.000Z (over 8 years ago)
- Last Synced: 2025-05-13T15:57:01.742Z (5 months ago)
- Topics: client, halite, haskell
- Language: Haskell
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hs-halite
Would you like to create a killer Halite client? Do you find that monad is just
a monoid in the category of endofunctors? Great! That means the `hs-halite`
module is just for you!
## API
### Types
As you probably know, there are four possible `Direction`s to choose when
moving. Each `Move` is defined by the field that we are moving from (`Int` and
`Int` for width and height respectively) and the `Direction`.
Overarching setup of the game `Board` contains your own numerical ID, size of
the board (both horizontally and vertically) and list of productions for each
field. A state of the `Game` contains the current field owners and their
strengths.
```haskell
data Direction = North | East | South | West
data Move = Move Direction Int Int
data Board = Board Int Int Int [Int]
data Game = Game [Int] [Int]
```
### Functions
First thing you will need to do is to `startGame`. It takes one parameter,
which is your username. In order to stay informed before each move, call the
`readGame` function. Once you found the most fearsome move, run `writeGame` to
execute it!
```haskell
startGame :: String -> IO (Board, Game)
readGame :: Board -> IO Game
writeGame :: [Move] -> IO ()
```
## License
The `hs-halite` package is licensed under the terms of the [2-clause BSD
license](LICENSE). In case you need any other license, feel free to
contact the author.
## Author
Daniel Lovasko