Partly taken from https://github.com/davidwhitney/CodeDojos
- https://hoogle.haskell.org/?hoogle For finding Haskell functions
- https://www.haskell.org/tutorial/functions.html
- https://www.haskell.org/tutorial/patterns.html
- https://hackage.haskell.org/package/CheatSheet-2.7/src/CheatSheet.pdf
There are a couple of easy ways to start coding in Haskell
- Get ghcup https://www.haskell.org/ghcup/
- Use ghcup to install ghc (the Haskell Compiler) and Cabal (build tool)
ghcup install ghc 9.10.1
ghcup install cabal
To run the whole project use 2. Open the program in the interactive ghc shell using
cabal repl MatchMaker.hs
- Run the program using
ghci> createDeathMatch
- Reload file changes and recompile using
:reload
You can also run individual functions or modules.
For example to run electHosts (defined in ElectHosts/ElectHosts.hs) with players (defined in Players.hs)
ghci> electHosts players
(Optionally) Get Visual Studio Code and download the Haskell Plugin
I have uploaded to project to codeboard.io
Matchmaking is a common part of online video games. While reading the changelog for the latest revision of "Halo: The Master Chief Collection" (http://www.polygon.com/2014/12/8/7352941/another-major-update-hits-halo-the-master-chief-collection-for), it became apparent that it's something that can easily go wrong, and has lots of interesting subtleties - and is ripe for the slaying with some traditional TDD.
Given a pool of players searching for a game, there are a number of factors to consider:
- The skill of the player
- The latency / ping of the player
For this Game we will organize free-for-all deathmatches. Meaning there will be one or more games with maximum 6 players each. There are no teams, every player is on its own.
From these factors, emerge the following requirements:
- Each game needs a host
- Each game should be balanced
- Players who are partied, should be in the same Game
- The game should be balanced
- The lower the latency of the host, the better
- Matchmaking should be as quick as possible
We have a pool of players all looking to play a balanced, 6 player, free-for-all deathmatch.
The source files for you to edit can be found in the MatchMaking dir.
The main code is in Main.hs. Players.hs contains the Player and Game data types and a example list of players to test the application with. For the matchmaking process, ElectHosts.hs and BalancingGames.hs is used. For the implementation of the stories below, you should edit these two files.
As a server
When I have a queue of players waiting for a free for all deathmatch
Then I should elect the most appropriate hosts for those matches
Accept:
Hosts should be as low-latency as possible
As a server
When I have a pool of players waiting for a free for all deathmatch
Then players in the game should be of roughly the same skill level
Accept:
Minimise the standard deviation of skill between players
Games should be between 2 and 6 players.
As a server
When I form teams
Then players who are partied together should be in the same Game